import * as _ from "lodash"; import { IStringMap } from "./collections"; export type promised = (...args: any[]) => Promise; const _factory: IStringMap = {}; // TODO: Function export const functionFactory = (id: string, func: T): T => { if (_.isNil(_factory[id])) { _factory[id] = func; } return _factory[id]; }