DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
      • afterPreviousEvents
      • collecting
      • dispatch
      • dispatching
      • queue
      • start
      • stop
    • can-observation
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-event/batch/batch
  • /
  • queue
  • / On this page
    • queue

      function

      Queues a method to be called.

      • source

      batch.queue(task)

      Queues a method to be called in the current collecting queue if there is one. If there is a dispatching queue, it will create a batch and add the task to that batch. Finally, if there is no batch, the task will be executed immediately.

      var me = {
        say: function(message){
          console.log(this.name,"says", message);
        }
      }
      batch.queue([me.say, me, ["hi"]]);
      

      Parameters

      1. task {Array<function,*,Array>}:

        An array that details a function to be called, the context the function should be called with, and the arguments to the function like: [function,context, [arg1, arg2]]

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.