var slice = [].slice;
module.exports = {
_bindEvent: function() {
return this.bindEvent || this.props.bindEvent || 'change';
},
_bindStore: function() {
return (typeof this.bindStore === "function" ? this.bindStore() : void 0) || this.bindStore;
},
_bindUpdate: function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (this.bindUpdate != null) {
return this.bindUpdate.apply(this, args);
} else {
return this.setState({});
}
},
_addListener: function() {
var bindStore;
this.boundEvent = this._bindEvent();
Iif (typeof this.addBindListener === "function") {
this.addBindListener();
}
bindStore = this._bindStore();
Eif (this._bindStore != null) {
return bindStore.on(this.boundEvent, this._bindUpdate);
}
},
_removeListener: function() {
var bindStore;
Iif (typeof this.removeBindListener === "function") {
this.removeBindListener();
}
bindStore = this._bindStore();
Eif (this._bindStore != null) {
return bindStore.off(this.boundEvent, this._bindUpdate);
}
},
componentWillMount: function() {
return this._addListener();
},
componentWillUnmount: function() {
return this._removeListener();
}
};
|