react-native-worklets
Version:
The React Native multithreading library
12 lines (10 loc) • 317 B
text/typescript
;
/**
* This is Jest implementation of `requestAnimationFrame` that is required by
* React Native for test purposes.
*/
export function mockedRequestAnimationFrame(
callback: (timestamp: number) => void
): ReturnType<typeof setTimeout> {
return setTimeout(() => callback(performance.now()), 0);
}