repeat
create repeating task chains
Contents
Features
Install
From NPM:
> npm i repeat
Chain
Creating a new chain
The following chain will execute all tasks every second. A task is any callable
function.
import { Chain } from 'repeat'
let chain = new Chain()
chain
.add(
() => console.log('how are you?'),
() => console.log('good')
)
.every(1000)
Examples
The following methods are available on the chain.
add
chain.add(
() => console.log('cat'),
() => console.log('dog'),
() => console.log('fish')
)
once
chain.once()
every
chain.every(1000)
forever
chain.forever()
cancel
chain.cancel()
Contributing
Pull requests are encouraged. 😁