2016-01-22 15:08:58 +00:00
|
|
|
/**
|
|
|
|
* Create deferred object.
|
2017-02-05 03:54:58 +00:00
|
|
|
*
|
2016-01-22 15:08:58 +00:00
|
|
|
* @returns {{promise, resolve, reject}}
|
|
|
|
*/
|
2017-02-05 03:54:58 +00:00
|
|
|
export function createDeferred() {
|
|
|
|
const deferred = {};
|
2016-01-22 15:08:58 +00:00
|
|
|
|
2017-02-05 03:54:58 +00:00
|
|
|
deferred.promise = new Promise((resolve, reject) => {
|
2016-01-22 15:08:58 +00:00
|
|
|
deferred.resolve = resolve;
|
|
|
|
deferred.reject = reject;
|
|
|
|
});
|
|
|
|
|
|
|
|
return deferred;
|
|
|
|
}
|