react-native-gesture-handler
Version:
Declarative API exposing native platform touch and gesture system to React Native
8 lines (7 loc) • 379 B
JavaScript
// We check for typeof requestAnimationFrame because of SSR
// Functions are bound to null to avoid issues with scope when using Metro inline requires.
export const ghQueueMicrotask = typeof setImmediate === 'function'
? setImmediate.bind(null)
: typeof requestAnimationFrame === 'function'
? requestAnimationFrame.bind(null)
: queueMicrotask.bind(null);