Module: mixins/signalable

mixins/signalable

Add the ability to fire signals on your objects. Signals are events, but hard coded into the object and don't rely on strings like other events and eventables

Source:

Requires

Classes

Signal

Type Definitions

SignalOptions

Properties:
Name Type Argument Description
memorize boolean <optional>

If Signal should keep record of previously dispatched parameters and automatically execute listener. Defaults to false

params array <optional>

Default parameters passed to listener during Signal.raise/Signal.fire/Signal.trigger and SignalBinding.execute. (curried parameters). Defaults to null

context object <optional>

When provided the signal will be raised in the context of this object. Defaults to this - the signal host

Source:
Example
signals:{
    opened: null,
    twisted: { memorize:true },
    applied: { memorize: false, params:[one, two] }
}

// Setting the context initially can be a hassle, so this also supports a function that returns a hash

signals: function(){
    return {
    opened: null,
    twisted: { memorize:true },
    applied: { memorize: false, params:[one, two] },
    reversed: {context: someOtherRuntimeObject}
    };
}
DocStrap Copyright © 2012-2013 The contributors to the JSDoc3 and DocStrap projects.
Documentation generated by JSDoc 3.3.0-alpha5 on Mon Jul 7th 2014 using the DocStrap template.