Becklyn / mojave

A library of commonly used JavaScript tools and helpers by Becklyn
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Avoid rejecting animation director promise #71

Closed keichinger closed 6 years ago

keichinger commented 6 years ago

We’re now always resolving to prevent any promise chain errors bubbling into user land code since it’s an expected code and not an exception.

Instead of cancelling the promise with undefined, we’re resolving with an new mojave.AnimationResult object that represents various states

apfelbox commented 6 years ago

The AnimationResult only has two states: interrupted or finished.

So we can just use true (finished) and false (interrupted).

keichinger commented 6 years ago

So should it remain an object then or should we just resolve the AnimationDirector Promise with true and false?

apfelbox commented 6 years ago

I would just use a boolean

keichinger commented 6 years ago

Fair enough. I've appended the changes to the previous commit to keep the mojave.AnimationResult type off the history to avoid any potential confusion.

keichinger commented 6 years ago

Build errors are unrelated to the changes. It's just SauceLabs being SauceLabs again. The test browsers can't be spawned thus the build has failed.

apfelbox commented 6 years ago

Thanks!