1.0.5 • Published 4 years ago
@jswork/raf-interval v1.0.5
raf-interval
Behaves the same as setInterval except uses requestAnimationFrame() where possible for better performance.
installation
npm install @jswork/raf-intervalusage
import rafInterval from '@jswork/raf-interval';
// setup a timer
const res = rafInterval(()=>{
console.log('task');
},1000);
// destroy
res.destroy();license
Code released under the MIT license.