at.pkgs.EventBinder

イベント通知用のバインダを提供します。

使用例

様々な使用方法

var binder;

binder = new at.pkgs.EventBinder();
binder.bind(function(value) {
    console.log('0: fired! ' + value);
});
binder.bind(function(value) {
    console.log('1: fired! ' + value);
    // 自分自身をunbindします。
    binder.unbind(this);
    // 後続のハンドラを呼び出しません。
    return false;
});
binder.bind(function(value) {
    console.log('2: fired! ' + value);
});
binder.bind(function(value) {
    console.log('-1: fired! ' + value);
}, true); // このハンドラを先頭に追加します。

binder.fire('first');
// -1: fired! first
// 0: fired! first
// 1: fired! first

binder.fire('second');
// -1: fired! second
// 0: fired! second
// 2: fired! second
Copyright (c) 2009-2014, Architector Inc., Japan.
Documentation generated by JSDoc 3.2.0 on Tue Aug 26 2014 22:27:18 GMT+0900 (JST) using the DocStrap template.