Closed felamaslen closed 1 year ago
thanks for the PR. this looks like a good feature to include. I'm working on releasing v0.11 with animation speed updates. so might bundle this with that release.
One thing I want to take a look at first before merging this is how this affects other loaders. I want to make sure we have a fairly consistent API, and avoid having one offs for individual loaders. especially when it comes to the props typing.
This PR adds the delay prop to every single loader, so people might assume the delay can work on every loader.
thanks for the PR. this looks like a good feature to include. I'm working on releasing v0.11 with animation speed updates. so might bundle this with that release.
One thing I want to take a look at first before merging this is how this affects other loaders. I want to make sure we have a fairly consistent API, and avoid having one offs for individual loaders. especially when it comes to the props typing.
This PR adds the delay prop to every single loader, so people might assume the delay can work on every loader.
Agreed that it should be implemented on every loader.
Perhaps it would be good to implement a spec which any loader must conform to.
Yeah definitely. I think the feature for 0.11 is going to be animation control. I think this could be a good feature for 0.12
This is a simple feature to delay the animation on PuffLoader. I suppose it could be extended to other loaders too.
The idea is that if you have multiple things loading, and you're rendering the loader from multiple places, you want to keep track of which stage of the animation the loader is in - otherwise, the animation will reset back to the beginning resulting in a jerky animation.
There is an article detailing the application of this here: https://www.selbekk.io/blog/2019/08/how-to-stop-your-spinner-from-jumping-in-react/