Neglected Parking Meter

    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.
    })

    Keywords

    none

    Install

    npm i readydevice

    DownloadsWeekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • rt2zz