mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-12 12:10:48 +08:00
Add tests for Ember.RSVP.Promise from Ember docs
This commit is contained in:
1 parent
a44c7d653b
commit
8e49b8e8c8
1 file changed
+15
@@ -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
|
||||
});
|
||||
Reference in new issue
Block a user