subscriber.js revision 78d3c37c02e77731a25f370f9fac264ef51f01a9
/**
* Stores the subscriber information to be used when the event fires.
* @param {Function} fn The wrapped function to execute.
* @param {Object} context The value of the keyword 'this' in the listener.
* @param {Array} args* 0..n additional arguments to supply the listener.
*
* @class Subscriber
* @constructor
*/
/**
* The callback that will be execute when the event fires
* This is wrapped by Y.rbind if obj was supplied.
* @property fn
* @type Function
*/
/**
* Optional 'this' keyword for the listener
* @property context
* @type Object
*/
/**
* Unique subscriber id
* @property id
* @type String
*/
/**
* Additional arguments to propagate to the subscriber
* @property args
* @type Array
*/
/**
* Custom events for a given fire transaction.
* @property events
* @type {EventTarget}
*/
// this.events = null;
/**
* This listener only reacts to the event once
* @property once
*/
// this.once = false;
};
Y.Subscriber.prototype = {
if (this.postponed) {
delete this.fn;
delete this.context;
} else {
delete this.postponed;
return null;
}
}
case 0:
break;
case 1:
break;
default:
if (a || args) {
} else {
}
}
if (this.once) {
}
return ret;
},
/**
* Executes the subscriber.
* @method notify
* @param args {Array} Arguments array for the subscriber.
* @param ce {CustomEvent} The custom event that sent the notification.
*/
var c = this.context,
ret = true;
if (!c) {
}
// only catch errors if we will not re-throw them.
} else {
try {
} catch (e) {
}
}
return ret;
},
/**
* Returns true if the fn and obj match this objects properties.
* Used by the unsubscribe method to match the right subscriber.
*
* @method contains
* @param {Function} fn the function to execute.
* @param {Object} context optional 'this' keyword for the listener.
* @return {boolean} true if the supplied arguments match this
* subscriber's signature.
*/
if (context) {
} else {
}
}
};