1.0.5 • Published 8 years ago

cb-is-called v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
8 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

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago