Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

fregante/promise-waitfor-es5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

promise-waitfor-es5

Build Status Dependencies npm version

Just run npm install promise-waitfor-es5

Documentation

Promise waitFor(Function condition, interval int=50)

Examples

const waitFor = require('promise-waitfor-es5');

waitFor(CONDITION)
.then(...)

waitFor(CONDITION, TEST_INTERVAL)
.then(...)

Alternatively, you can use a Promise constructor other than global.Promise:

const waitFor = require('promise-waitfor-es5').use(YOUR_PROMISE_CONSTRUCTOR_HERE);

For now more info check test.js and the index.js for further information.

Changelog

2.0.0-rc1

  • Removed the second argument as it was generally confusing and can be easily replace with an extra .then() call, eg: waitFor(() => {...}, () => getSomething() can be converted to waitFor() => {...)).then(getSomething)
  • Updated eslint config, eslint is now a dev dependency.

2.0.0

  • waitFor is now default bound to the native Promise implementation.
  • In order to use a custom one you now need to use const wf = require('promise-waitfor-es5)'.use(MY_IMPL.

About

(Forked to make it ES5) Promise polling utility

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%