Détail du package

@liuyunjs/timer

liuyunjs3MIT0.0.4

定时器的封装

readme

install


@npm: npm install @liuyunjs/timer -S

@yarn: yarn add @liuyunjs/timer

Quick


import Timer from '@liuyunjs/timer';

const timer = new Timer();

timer.setTimeout(() => console.log('hello world'), 1000);
timer.clearTimeout();

timer.setInterval(() => console.log('hello world'), 1000);
timer.clearInterval();

timer.rAF(() => console.log('hello world'));
timer.cAF();