Jazz-Soft.net

We make it sound!

Home » Documentation » JZZ.js » Developer API

Developer API

These calls are not recommended to use in your applications.

However, they may be helpful if you are making changes in JZZ.js itself, or creating additional modules.

_push()

_push(func, arg) - push the call in the end of the object's execution queue. If the object is ready, immediately execute it.

func - the function to call; it will be executed in the context of the current object.

arg - the arguments array to pass to the function; can be an empty array.

This is how the chaining works inside.

_slip()

_slip(func, arg) - slip the call in the beginning of the execution queue, before the other calls.

Same arguments as above.

_pause()

_pause() - pause the exacution of the object's queue.

Used mostly during the asynchronous object initialization.

_resume()

_resume() - resume the exacution of the object's queue.

Because every object is created in paused state, it has to be resumed at some point of its lifetime.

_break()

_break(msg) - make the object fail the operation.

If or() is the next call in the object's queue, it will execute. All subsequent chained calls will be ignored.

If msg is not empty, it will be added to the object's error log.

_repair()

_repair() - undo the effect of _break(). Can be normally used inside the or() call.

_crash()

_crash(msg) - same as _break(msg) followed by _resume(). These two often go together.

Example

JZZ().and(function(){ this._break("Just kidding!"); })
     .or(function(){ this._repair(); })
     .and(function(){ alert(this.err()); });

See also