Promise support
See original GitHub issueWould it be out-of-scope to provide a Promise for animation completion? Something like Web Animations finished
Promise:
var myAnimation = anime({
targets: ['.blue', '.green'],
translateX: '13rem',
rotate: 180,
borderRadius: 8,
duration: 2000,
loop: true
});
myAnimation.finished.then(() => {
/* ... */
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:27 (12 by maintainers)
Top Results From Across the Web
PROMISE Support Center
Tech Support Contact Information: ; Promise Global Support email: support@promise.com. PROMISE U.S.A.. Phone : +1 (408) 645-3469. Phone : +1 (408) 876-5886 ...
Read more >Promises | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end ... A promise represents the eventual result of an asynchronous operation....
Read more >Promise support definition and meaning - Collins Dictionary
If you support someone or their ideas or aims, you agree with them, and perhaps help them because you want them to succeed....
Read more >Promise - JavaScript - MDN Web Docs
The Promise object represents the eventual completion (or failure) of an ... used to wrap functions that do not already support promises.
Read more >PROMISe - PA Department of Human Services
PROMISe. Please use the links below to find the information you need. ... Provide high-quality supports and protections to vulnerable Pennsylvanians.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe something like this (inspired by jQuery) could work:
The
promise()
invocation would infer a new Promise that will resolve when the current animation completes. Ifloop: false
is set, then the same Promise would be returned.I’ve built a promise based animation class. Works really well. Currently I’ve only got it working with “tweens” not looping animations but I’m working on it. I’m using it with threejs so not for DOM manipulations which is where something like anime is probably better suited.
Anyway the basic premise is that you start the animation and return a promise from that method, then resolve the promise with an
end
method. In my class the end method is private. There’s a publicstop
method that can be called which also returns the promise then calls end.Anyway it’s really useful for chaining, a little cleaner than callback chains in the
complete
prop. Would be really cool to see anime support promises. It’s such a nice way of animating, makes it easy to do things like