feat(loaders): Add duration prop to dots loader #201
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Fixes #147
Description
Previously the dots loader had a velocity prop that didn't really work as expected when changing the value. To align with the spinner loader this PR adds a
durationprop which accepts a number in ms, default is 1250ms, to either slow down or speed up the animation.Detail
This is a breaking change as it removes the
velocityprop in favour of thedurationprop.It also heavily refactors the code of the dots loader to follow the same approach used in the spinner loader.
Unfortunately due to our IE11 support we have to do these animations via js which are fairly CPU intensive compared to css animations.
Pre published: https://garden.zendesk.com/react-components/loaders/#!/Dots/3
If anyone has any optimisations I can do I will be forever grateful.
Checklist
designer as a reviewer)
component
yarn start)src/index.jsexport