1.0.5 • Published 7 years ago

cb-is-called v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

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()
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago