UNPKG

@thi.ng/compose

Version:

Optimized functional composition helpers

18 lines (17 loc) 268 B
const trampoline = (f) => { while (typeof f === "function") { f = f(); } return f; }; const trampolineAsync = async (f) => { f = await f; while (typeof f === "function") { f = await f(); } return f; }; export { trampoline, trampolineAsync };