import util from './util'; export class Doer { private _reqFn: (doParams: any) => Promise; constructor(gateway: string, adapter: string) { this._reqFn = (doParams: any) => { let url = `${gateway}/api/adapters/${adapter}/do`; return util.authorizedFetch("POST", url, JSON.stringify(doParams)); } } do(doParams: any): Promise { return this._reqFn(doParams); } }