3.0.3 • Published 5 years ago

requestanimationframe-timer v3.0.3

Weekly downloads
18,629
License
ISC
Repository
github
Last release
5 years ago
npm install --save-dev requestanimationframe-timer
import { setInterval, setTimeout, clearInterval, clearTimeout } from 'requestanimationframe-timer';

const id_1 = setTimeout((a) => console.log(a), 1000, '1000 ms timeout');
const id_2 = setInterval((a) => console.log(a), 2000, '2000 ms interval');
setTimeout(() => {
  clearTimeout(id_1);
  clearInterval(id_2);
}, 10000);