Sign in
apache
/
cordova-blackberry
/
refs/tags/v2.1.0.3
/
.
/
blackberry10
/
node_modules
/
plugman
/
node_modules
/
ncallbacks
/
ncallbacks.js
blob: cd13ef4426faa53fa4d8268b06fe861e71080b39 [
file
] [
log
] [
blame
]
/*
* stupid-simple "flow control"
*/
module
.
exports
=
function
nCallbacks
(
count
,
callback
)
{
var
n
=
count
;
return
function
(
err
)
{
if
(
err
)
callback
(
err
)
if
(
n
<
0
)
callback
(
'called too many times'
)
--
n
if
(
n
==
0
)
callback
(
null
)
}
}