mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Change Parse.Promise to be a class
Also update is, error, as and when method to be static method with corresponding arguments.
This commit is contained in:
@@ -400,3 +400,16 @@ function test_view() {
|
||||
var model = Parse.User.current();
|
||||
var view = new Parse.View<Parse.User>();
|
||||
}
|
||||
|
||||
function test_promise() {
|
||||
let resolved = Parse.Promise.as(true);
|
||||
let rejected = Parse.Promise.error("an error object");
|
||||
Parse.Promise.when([resolved, rejected]).then(function() {
|
||||
// success
|
||||
}, function() {
|
||||
// failed
|
||||
});
|
||||
|
||||
// can check whether an object is a Parse.Promise object or not
|
||||
Parse.Promise.is(resolved);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user