RSVP.hashSettled()

hashSettled (object, label) Promisestatic Defined in bower_components/rsvp/lib/rsvp/hash-settled.js:23 RSVP.hashSettled is similar to RSVP.allSettled, but takes an object instead of an array for its promises argument. Unlike RSVP.all or RSVP.hash, which implement a fail-fast method, but like RSVP.allSettled, hashSettled waits until all the constituent promises have returned and then shows you all the results with their states and values/reasons. This is useful if you want to handle multiple

RSVP.map()

map (promises, mapFn, label) Promisestatic Defined in bower_components/rsvp/lib/rsvp/map.js:6 RSVP.map is similar to JavaScript's native map method, except that it waits for all promises to become fulfilled before running the mapFn on each item in given to promises. RSVP.map returns a promise that will become fulfilled with the result of running mapFn on the values the promises become fulfilled with. For example: var promise1 = RSVP.resolve(1); var promise2 = RSVP.resolve(2); var promis

RSVP.EventTarget#trigger()

trigger (eventName, options) private Defined in bower_components/rsvp/lib/rsvp/events.js:163 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(

RSVP.EventTarget#on()

on (eventName, callback) private Defined in bower_components/rsvp/lib/rsvp/events.js:74 Registers a callback to be executed when eventName is triggered object.on('event', function(eventInfo){ // handle the event }); object.trigger('event'); Parameters: eventName String name of the event to listen for callback Function function to be called when the event is triggered.

RSVP.filter()

filter (promises, filterFn, label) Promisestatic Defined in bower_components/rsvp/lib/rsvp/filter.js:6 RSVP.filter is similar to JavaScript's native filter method, except that it waits for all promises to become fulfilled before running the filterFn on each item in given to promises. RSVP.filter returns a promise that will become fulfilled with the result of running filterFn on the values the promises become fulfilled with. For example: var promise1 = RSVP.resolve(1); var promise2 = RSVP

RSVP.hash()

hash (object, label) Promisestatic Defined in bower_components/rsvp/lib/rsvp/hash.js:4 RSVP.hash is similar to RSVP.all, but takes an object instead of an array for its promises argument. Returns a promise that is fulfilled when all the given promises have been fulfilled, or rejected if any of them become rejected. The returned promise is fulfilled with a hash that has the same key names as the promises object argument. If any of the values in the object are not promises, they will simply b

RSVP.EventTarget

RSVP.EventTarget Class Defined in: bower_components/rsvp/lib/rsvp/events.js:19 Module: ember

RSVP.EventTarget#off()

off (eventName, callback) private Defined in bower_components/rsvp/lib/rsvp/events.js:109 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

RSVP.EventTarget#mixin()

mixin (object) private Defined in bower_components/rsvp/lib/rsvp/events.js:24 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

RSVP.denodeify()

denodeify (nodeFunc, options) Functionstatic Defined in bower_components/rsvp/lib/rsvp/node.js:73 RSVP.denodeify takes a 'node-style' function and returns a function that will return an RSVP.Promise. You can use denodeify in Node.js or the browser when you'd prefer to use promises over using callbacks. For example, denodeify transforms the following: var fs = require('fs'); fs.readFile('myfile.txt', function(err, data){ if (err) return handleError(err); handleData(data); }); into: var