Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Eser Ozvataf edited this page Jun 17, 2015 · 2 revisions

Deferred object manages the state of completed operations, and utilizes construction of event-driven callback queues.

Constructing a deferred object

Usage: new $l.deferred()

var promise = new $l.deferred();
promise.done(function (x) { console.log('result is ' + x); });

setTimeout(function () { promise.resolve(5); }, 200);

Clone this wiki locally