1.1.0 • Published 2 years ago

@bitty/insist v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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.