-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented Promises support #143
Conversation
Continue from #87. |
It is possible that @domenic will poke you with something sharp for rejecting without there actually being an error. From what I can understand that's a no-no. I think that rejecting with a a reason that is not |
@mikaelkaron that's cool. My intention was to get this out there so that we can decide on the optimal solution. How would you expect a promise to behave for a stopped animation? Fulfill it? Reject it? |
Is stopping an animation an exceptional situation? I.e. if this was a synchronous function, would it thrown an exception? |
@domenic thanks for the link! this is quite helpful. Since this is an act initiated by the user I guess it won't count as an exceptional situation. In a sync promises-less API the user expects the usual flow, however, the So I guess we should resolve it, but still somehow suppress the |
Oh! Silly me 👻 resolving will just resolve and not do anything else. |
This is about 1 day away from being implemented. |
Integrated. See http://velocityjs.org/#promises. Thank you for your help, @domenic and @mikaelkaron. |
Notice on stop I reject the promise with the chained context. I know it's contrary to what Dominic said but it seemed to be the best solution, and I couldn't find anything in the specs about the
reason
having to be an error.Also, I went over the code and think I covered all places where you return from the
animate
method, so please check if I missed anything.