corbt / next-frame

Returns a promise that resolves on the next animationFrame
BSD 2-Clause "Simplified" License
167 stars 15 forks source link

Use `Promise.resolve()` to simplify `nextFrame.mapInFrames` #2

Closed insaindesign closed 8 years ago

insaindesign commented 8 years ago

Promise.resolve does a lot of the queueing magic that was formally in mapInFrames, using that simplifies the code somewhat.

Added a jest test to sanity check the result is the same, run using npm test.

corbt commented 8 years ago

This looks great! Thanks for the contribution.