@cfware/callback-array-once
v1.0.5
Published
Run and clear an array of callbacks
Downloads
27
Readme
@cfware/callback-array-once
Run and clear an array of callbacks.
Usage
import runCallbacks from '@cfware/callback-array-once';
const cbs = [
(arg1, arg2) => {
console.log(arg1, arg2);
},
(arg1, arg2) => {
console.log(arg1 + 1, arg2 + 1);
}
];
runCallbacks(cbs, 1, 2);
console.log(cbs.length);
/* Prints:
* 1 2
* 2 3
* 0
*/