initial
This commit is contained in:
15
dist/index.d.ts
vendored
Normal file
15
dist/index.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import 'typings-global';
|
||||
export interface IResolve<T> {
|
||||
(value?: T | Promise<T>): void;
|
||||
}
|
||||
export interface IReject {
|
||||
(reason?: any): void;
|
||||
}
|
||||
export declare class Deferred<T> {
|
||||
promise: Promise<T>;
|
||||
resolve: IResolve<T>;
|
||||
reject: IReject;
|
||||
constructor();
|
||||
}
|
||||
export declare let defer: <T>() => Deferred<T>;
|
||||
export declare let all: () => void;
|
17
dist/index.js
vendored
Normal file
17
dist/index.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
class Deferred {
|
||||
constructor() {
|
||||
this.promise = new Promise((resolve, reject) => {
|
||||
this.resolve = resolve;
|
||||
this.reject = reject;
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Deferred = Deferred;
|
||||
exports.defer = () => {
|
||||
return new Deferred();
|
||||
};
|
||||
exports.all = () => {
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBVXZCO0lBSUk7UUFDSSxJQUFJLENBQUMsT0FBTyxHQUFHLElBQUksT0FBTyxDQUFJLENBQUMsT0FBTyxFQUFFLE1BQU07WUFDMUMsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUE7WUFDdEIsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUE7UUFDeEIsQ0FBQyxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0o7QUFWRCw0QkFVQztBQUVVLFFBQUEsS0FBSyxHQUFHO0lBQ2YsTUFBTSxDQUFDLElBQUksUUFBUSxFQUFLLENBQUE7QUFDNUIsQ0FBQyxDQUFBO0FBR1UsUUFBQSxHQUFHLEdBQUc7QUFFakIsQ0FBQyxDQUFBIn0=
|
Reference in New Issue
Block a user