corbt / next-frame

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

Why not InteractionManager.runAfterInteractions? #6

Closed EgidioCaprino closed 5 years ago

EgidioCaprino commented 5 years ago

Hi @corbt πŸ‘‹

I like your idea, but I have a question.

Why is your logic based on requestAnimationFrame rather than InteractionManager.runAfterInteractions. React Native doc says

requestAnimationFrame(): for code that animates a view over time. runAfterInteractions(): run code later, without delaying active animations.

corbt commented 5 years ago

Fair point! I don’t recall whether that callback was available when I wrote this library, but in many cases that may be the more appropriate choice.

On Mon, Jan 14, 2019 at 01:10 Egidio Caprino notifications@github.com wrote:

Hi @corbt https://github.com/corbt πŸ‘‹

I like your idea, but I have a question.

Why is your logic based on requestAnimationFrame rather than InteractionManager.runAfterInteractions. React Native doc https://facebook.github.io/react-native/docs/timers says

requestAnimationFrame(): for code that animates a view over time. runAfterInteractions(): run code later, without delaying active animations.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/corbt/next-frame/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKxKiIZyevUhqkQCAWjUeg4CkZVx91Sks5vDEmTgaJpZM4Z92Kz .