reject

creates and rejects a promise

object reject(any reason);
reasonanythe reason why the promise is rejected
objectrejected promise

Example

webix.promise.reject("Incorrect value").then(
    function(success){ /*not called*/ }, 
    function(){ 
        console.log(error); //"Incorrect value"
    }
);
 
webix.promise.reject("Incorrect value").fail(function(error){
   console.log(error); //"Incorrect value"
});

Back to top