JSPM

interval-check

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12166F
  • License MIT

Polling check by intervally

Package Exports

  • interval-check

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (interval-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

interval-check

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

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 or git 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)' or git 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, moyuyc95@gmail.com.

License

MIT - imcuttle 🐟