Skip to content

guisouza/Ordine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

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/

About

🔃 Simple queue system to handle callbacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published