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