1.0.5 • Published 7 years ago
cb-is-called v1.0.5
Install
$ npm install --save cb-is-called
Usage
const wrap_cb = require('cb-is-called');
function test(a, cb) {
cb = wrap_cb(cb)
if (a) {
cb(null)
}
}
function called () {
test(true, function(data) {
console.log('data:', data)
})
}
function uncalled () {
test(false, function(data) {
console.log('data:', data)
})
}
called()
uncalled()