https://github.com/rt2zz/readydevice
Avoid coordinated bootstrap sequences or singleton pseudo-global devices
https://github.com/rt2zz/readydevice
Last synced: 18 days ago
JSON representation
Avoid coordinated bootstrap sequences or singleton pseudo-global devices
- Host: GitHub
- URL: https://github.com/rt2zz/readydevice
- Owner: rt2zz
- Created: 2015-09-04T23:27:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-04T23:34:19.000Z (over 9 years ago)
- Last Synced: 2025-04-30T21:47:12.484Z (24 days ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# readydevice
Avoid coordinated bootstrap sequences or singleton pseudo-global devices.## Usage
It is not particularly pretty, but it works and does not bleed complexity.
```js
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.
})
```