1.0.2 • Published 5 years ago

light-async-polling v1.0.2

Weekly downloads
38
License
ISC
Repository
github
Last release
5 years ago

:arrows_clockwise: light-async-polling

Super light javascript function for making polling

:fire: Usage:

  const polling = require('light-async-polling')

  await polling(async () => {
    const r = yourFunction()
    if (
      r
    ) {
      return true //stop polling
    } else {
      return false //continue polling
    }

  }, 2000) //milliseconds

:video_game: Run examples:

  npm run examples