2016-01-22 15:08:58 +00:00
|
|
|
/**
|
|
|
|
* Create deferred object.
|
|
|
|
* @returns {{promise, resolve, reject}}
|
|
|
|
*/
|
|
|
|
export function createDeferred () {
|
|
|
|
let deferred = {};
|
|
|
|
|
|
|
|
deferred.promise = new Promise(function (resolve, reject) {
|
|
|
|
deferred.resolve = resolve;
|
|
|
|
deferred.reject = reject;
|
|
|
|
});
|
|
|
|
|
|
|
|
return deferred;
|
|
|
|
}
|
2016-02-05 15:04:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reload page.
|
|
|
|
*/
|
|
|
|
export function reload () {
|
|
|
|
window.location.reload();
|
|
|
|
}
|