insistence
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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.

Package Sidebar

Install

npm i insistence

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

184 kB

Total Files

13

Last publish

Collaborators

  • vitorluizc