UNPKG

436 BJavaScriptView Raw
1import Promise from 'bluebird';
2/**
3 * Defered promise like in Q and $q
4 *
5 * @returns {{ resolve: (res: any) => void, reject: (res: any) => void, promise: Promise<{}> }}
6 */
7export const blueDefer = () => {
8 let resolve, reject;
9 const promise = new Promise((rs, rj) => {
10 resolve = rs;
11 reject = rj;
12 });
13 return {
14 resolve,
15 reject,
16 promise
17 };
18};
19
20export default blueDefer;
21//# sourceMappingURL=defer.js.map
\No newline at end of file