Ember.RSVP.EventTarget Class
Methods
mixin
        
            (
        private
    
    - 
                        
object 
RSVP.EventTarget.mixin extends an object with EventTarget methods. For
Example:
var object = {};
RSVP.EventTarget.mixin(object);
object.on("finished", function(event) {
  // handle event
});
object.trigger("finished", { detail: value });
EventTarget.mixin also works with prototypes:
var Person = function() {};
RSVP.EventTarget.mixin(Person.prototype);
var yehuda = new Person();
var tom = new Person();
yehuda.on("poke", function(event) {
  console.log("Yehuda says OW");
});
tom.on("poke", function(event) {
  console.log("Tom says OW");
});
yehuda.trigger("poke");
tom.trigger("poke");
    Parameters:
- 
                        
objectObjectobject to extend with EventTarget methods
 
off
        
            (
        private
    
    - 
                        
eventName - 
                        
callback 
You can use off to stop firing a particular callback for an event:
function doStuff() { // do stuff! }
object.on('stuff', doStuff);
object.trigger('stuff'); // doStuff will be called
// Unregister ONLY the doStuff callback
object.off('stuff', doStuff);
object.trigger('stuff'); // doStuff will NOT be called
If you don't pass a callback argument to off, ALL callbacks for the
event will not be executed when the event fires. For example:
var callback1 = function(){};
var callback2 = function(){};
object.on('stuff', callback1);
object.on('stuff', callback2);
object.trigger('stuff'); // callback1 and callback2 will be executed.
object.off('stuff');
object.trigger('stuff'); // callback1 and callback2 will not be executed!
    on
        
            (
        private
    
    - 
                        
eventName - 
                        
callback 
Registers a callback to be executed when eventName is triggered
object.on('event', function(eventInfo){
  // handle the event
});
object.trigger('event');
    trigger
        
            (
        private
    
    - 
                        
eventName - 
                        
options 
Use trigger to fire custom events. For example:
object.on('foo', function(){
  console.log('foo event happened!');
});
object.trigger('foo');
// 'foo event happened!' logged to the console
You can also pass a value as a second argument to trigger that will be
passed as an argument to all event listeners for the event:
object.on('foo', function(value){
  console.log(value.name);
});
object.trigger('foo', { name: 'bar' });
// 'bar' logged to the console
    Parameters:
- 
                        
eventNameStringname of the event to be triggered
 - 
                        
optionsAnyoptional value to be passed to any event handlers for the given
eventName 
