F.add()

  • function
FuncUnit.add  

add(handler[, error][, context])

Adds a function to the queue.

Parameters

  1. handler {Object | function()}

    An object or function to define a step in the queue

    Handler as an Object
    An object that contains the method to run along with other properties:

    -method : the method to be called. It will be provided a success and error function to call -success : an optional callback to be called after the function is done -error : an error message if the command fails -timeout : the time until success should be called -bind : an object that will be 'this' of the success -type: the type of method (optional)

    Handler as a Function
    Similar to an Object, however the handler passed acts as the success function
  2. error {String}

    An optional error message if handler is passed as a function

  3. context {Object}

    An optional object to specify "this" inside handler. Enabled if handler is passed as a function