ordine
v1.1.0
Published
Callbacks made almost easy.
Downloads
45
Maintainers
Readme
Callbacks made almost easy
Simple queue system to handle callbacks
Constructor :
var myQueue = new Ordine(function(){
console.log('uh!?')
})
Constructor arguments :
callback(function): This the only required argument which is the callback for the queue.
#Enqueue method :
var myQueue = new Ordine(function(){
console.log('uh!?')
})
.enqueue(function(){
window.setTimeout(function(){
console.log('first')
myQueue.next()
},1000);
})
.enqueue(function(){
window.setTimeout(function(){
console.log('second')
myQueue.next()
},1000);
},false)
.enqueue(function(){
window.setTimeout(function(){
console.log('third')
myQueue.next()
},1000);
},true)
.run()
Enqueue arguments :
Proccess(function):
Asynchronous stuff.
Sync(boolean):
This argument have to be the answer for the question : "This process will wait the previous process end to be executed"
Run Method :
The run method trigger the queue execution.
// Cycle Icon designed by Nick Remis - http://www.thenounproject.com/nremis/