UNPKG

@onion-interceptor/pipes

Version:
35 lines (34 loc) 634 B
import { operate as r } from "onion-interceptor"; const w = (a) => r(async (o, t) => { try { await t(); } catch (c) { throw c; } finally { a(); } }), h = (a) => r(async (o, t) => { try { await t(); } catch (c) { throw a(c); } }), e = (a) => r(async (o, t) => { await new Promise((c) => setTimeout(c, a)), await t(); }), i = function(a, o, t) { return r(async (c, s) => { try { await s(), a(c); } catch (n) { throw (o == null ? void 0 : o(n)) ?? n; } finally { t == null || t(); } }); }; export { h as catchError, e as delay, w as finalize, i as tap };