interval-check
v1.0.2
Published
Polling check by intervally
Downloads
6
Maintainers
Readme
interval-check
Polling check by intervally
Installation
npm install interval-check
# or use yarn
yarn add interval-check
API
setIntervalCheck
Parameters
fn
{Function}shouldStop
{() => boolean | Promise}interval
{number}
Examples
import setIntervalCheck from 'interval-check'
let data
fetch('/data').then((res) => {
data = res
})
const dispose = setIntervalCheck(
() => {
console.log('fetching /data')
},
() => !!data,
1000
)
Returns Function
Contributing
- Fork it!
- Create your new branch:
git checkout -b feature-new
orgit checkout -b fix-which-bug
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
git commit -am 'feat: some description (close #123)'
orgit commit -am 'fix: some description (fix #123)'
- Push to the branch:
git push
- Submit a pull request :)
Authors
This library is written and maintained by imcuttle, [email protected].
License
MIT - imcuttle 🐟