Install
npm install taskticker
Usage
var taskCreator = run = stack = taskCreator count = 0; ; ; ;;
The functions are run according to the order they are defined.
Interface
taskCreator(integer milliseconds)
The integer argument is optional with a default of 1000.
var taskCreator = run = count = 0; ; ;
taskCreator.stack(integer)
Same as taskCreator, but this is the async version.
Calling the next
callback in your function calls the next function in the stack.
var taskCreator = require('taskticker'),
stack = taskCreator.stack(),
count = 0;
stack('first', function(next){
console.log('--first');
//call the second function in the stack.
next();
});
stack('second', function(){
console.log('--second');
});
What's taskticker for?
What ever you want to use it for, but testing might be a good idea.