readydevice

1.0.4 • Public • Published

readydevice

Avoid coordinated bootstrap sequences or singleton pseudo-global devices.

Usage

It is not particularly pretty, but it works and does not bleed complexity.

var readydevice = require('readydevice')
 
var getSomething = readydevice((ready) => {
  someAsyncSetup(function(something){
    ready(something)
  })
})
 
//...later
 
getSomething(function(something){
  //If the device is already `ready` it will immediately fire the callback.
  //Otherwise the callback will be queued and invoked once the device is ready.
})

/readydevice/

    Package Sidebar

    Install

    npm i readydevice

    Weekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • rt2zz