insistence
v0.2.0
Published
Insistently runs a callback and only resolves the promise when its result is truthy.
Downloads
42
Maintainers
Readme
Insistence
Insistently runs a callback and only resolves the promise when its result is truthy.
Install
Install using NPM or Yarn.
# Using NPM
npm i insistence
# Using Yarn
yarn add insistence
There's also an UMD version on unpkg.
<script src="https://unpkg.com/insistence"></script>
Usage
import insistence from 'insistence'
insistence(() => window.readyState === 'complete')
.then(() => {
// It's only resolved when window.readyState is 'complete'.
})
License
Released under MIT license. You can see it here.