Socket
Book a DemoInstallSign in
Socket

callback-store

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callback-store

A store for callbacks waiting for delayed response.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-75%
Maintainers
1
Weekly downloads
 
Created
Source

callback-store

A store for callbacks waiting for delayed response.

Dependency Status Build Status npm version Coverage Status

Installation

npm install --save callback-store

Usage

const cbStore = require('callback-store')

let callbacks = cbStore()
let uid = Math.random()
callbacks.add(uid, function(err) {
  if (err) {
    /* An error will happen if the callback isn't executed during 5 seconds */
    return
  }
  console.log('Hello world!')
}, 5000)

/* ... */

let cb = callbacks.get(uid)
cb()

License

The MIT License (MIT)

Keywords

callback

FAQs

Package last updated on 04 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts