@bitty/insist
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i @bitty/insist

Weekly Downloads

9

Version

1.1.0

License

MIT

Unpacked Size

22.8 kB

Total Files

15

Last publish

Collaborators

  • vitorluizc
  • bitty