0.2.0 • Published 6 years ago

insistence v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Insistence

Build status

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.