mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #2460 from kenkouot/ember-RSVP
[Ember] Add definition for Ember.RSVP.Promise constructor
This commit is contained in:
@@ -193,3 +193,18 @@ people2.some((person: Em.Object) => {
|
||||
});
|
||||
people2.everyProperty('isHappy', true);
|
||||
people2.someProperty('isHappy', true);
|
||||
|
||||
// Examples taken from http://emberjs.com/api/classes/Ember.RSVP.Promise.html
|
||||
var promise = new Ember.RSVP.Promise(function(resolve, reject) {
|
||||
// on success
|
||||
resolve('ok!');
|
||||
|
||||
// on failure
|
||||
reject('no-k!');
|
||||
});
|
||||
|
||||
promise.then(function(value) {
|
||||
// on fulfillment
|
||||
}, function(reason) {
|
||||
// on rejection
|
||||
});
|
||||
|
||||
Vendored
+1
@@ -1501,6 +1501,7 @@ declare module Ember {
|
||||
}
|
||||
module RSVP {
|
||||
class Promise {
|
||||
constructor(resolver: Function, label?: string);
|
||||
then(done?: Function, fail?: Function): Promise;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user