Open thiamsantos opened 7 years ago
Some other suggestions waiting for approval:
SVG
's for image rendering, so we're going to introduce a breaking change to the api. We need to add a basic migration guide for people using v1.0.x
to shift to v2.0.0
. I create a issue for each feature to be added. #16 #17 #18 #19
With simplify API, I was trying to say that the methods provided by the project should be more simple. Instead of proving two methods .init()
and .render()
could be exposed as just one function progressively()
.
.init()
and .render()
methods both have different & defined jobs to do. The init()
method is for initialisation of the initial variables, setting up event listeners. It doesn't contain any library logic. The render method is a private method to library (although I've exposed it in the public api to let people fiddle with it if they want) which adds library logic to the elements.
As for the issues, good job @thiamsantos. Priority one is to add offset option to current version and release a patch for v1.x.x
which I'll complete today or tomorrow. Then we can start working on v2.0.0
.
Could you show me a use case for the .render()
method? I just pointing that because I can't any use case for it outside the scroll event listener since it only render the images if the image is "on the view".
Consider a case where you want to toggle the loading of some image based on another image. To handle such situations, one might want to alter the render()
method and pop/push the image based on whether the other image is loaded.
Ps: It might not be the best example, but we can get a situation like that and hence having such methods (i.e. the methods which do not contain the rendering logic) can be exposed for developer.
Some things to do on the next major release. The changes can be made on different branch, can be called
v2
for convenience. Every suggestion needs to be approved, after that it will be included on the list below and further discussion about it should be made on its own issue.