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 resolves all promises in the result array
defer creates a new instance of a deferred object (a `promise`)
fcall calls a function and resolves as a promise
nfcall calls a node-style function (eg. expects callback as function(err, callback))
Back to top