promise

Interface for working with promise objects.

For more details, read the Ajax operations documentation.

Constructor

var my_promise = new webix.promise(function(success, fail){
    webix.ajax("some.php", function(text){
        if (text) success(text);
        else fail(text.error)
    })
});
 
//realdata - data that came from server
my_promise.then(function(realdata){
    ...
});
Methods
all allows to execute a function when results from all promises are received
defer creates a new instance of a deferred object (a `promise`)
race resolves or rejects the quickest promise
reject creates and rejects a promise
resolve creates and resolves a promise with the specified value
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.