A tiny (657B Gzipped) micro library to manage repeated tasks with ease.
yarn installimportTaskRepeaterfrom'task-repeater';constjob1=TaskRepeater().do(()=>{/*...*/}).every(1000).start();constjob2=TaskRepeater().do((itteration)=>console.log(`itteration No.${itteration} ...`)).do(()=>{/*...*/}).finally((itterationsDone)=>console.log(`tasks done. ${itterationsDone} itterations were completed.`)).for(5)// times.every(2_000)// interval in miliseconds .delay(1_000)// initial delay in miliseconds.start();job1.stop();// stops the repetitive callsjob1.reset();// resets the counter as if it isn't invoked👤 Omid Astaraki omid.ocean@gmail.com
- Github: @electather
- LinkedIn: @omid-astaraki
this package is based on Repeatr library developed by @theshem.
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2021 Omid Astaraki omid.ocean@gmail.com.
This project is MIT licensed.