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:
Egist Li
2015-10-06 18:31:37 +08:00
parent 05557455c4
commit d5a8570c0b
2 changed files with 19 additions and 6 deletions

View File

@@ -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);
}