(callback)
| 1 | export default function raf(callback) { |
| 2 | if (window.requestAnimationFrame) { |
| 3 | return window.requestAnimationFrame(callback); |
| 4 | } |
| 5 | |
| 6 | const nativeRaf = |
| 7 | window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; |
| 8 | |
| 9 | return nativeRaf |
| 10 | ? nativeRaf(callback) |
| 11 | : window.setTimeout(callback, 1e3 / 60); |
| 12 | } |
no outgoing calls
no test coverage detected