choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
21 lines (20 loc) • 691 B
TypeScript
import { IReactionDisposer } from 'mobx';
import Cache from '../cache';
export default class PromiseMerger<V, ARGS> {
timeout: number;
cache: Cache<string, V>;
promiseMap: Map<string | symbol, Map<string, {
resolves: Function[];
rejects: Function[];
}>>;
waitID: any;
callback: (codes: string[], args?: ARGS) => Promise<{
[key: string]: V;
}>;
reaction: IReactionDisposer;
constructor(callback: (codes: string[], args?: ARGS) => Promise<{
[key: string]: V;
}>, config: any, timeout?: number);
dispose(): void;
add(code: string, getBatchKey?: (defaultKey: symbol) => string | symbol, args?: ARGS): Promise<V>;
}