UNPKG

@baqhub/sdk-react

Version:

The official React SDK for the BAQ federated app platform.

12 lines (11 loc) 258 B
export function buildFetcher(promiseBuilder) { let res; const promise = promiseBuilder(); promise.then(result => (res = { result })); return () => { if (!res) { throw promise; } return res.result; }; }