UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

28 lines (27 loc) 839 B
import { struct as d } from "../../../utils/struct/main.js"; import { getter as s, enumerable as n } from "../../../utils/struct/property.js"; import { isUndefined as b } from "../../../utils/value/is.js"; import { noop as u } from "../../../utils/common.js"; const w = (o) => { let r, t, e; const l = () => { if (b(r)) return; const i = r.abort.bind(r); r = void 0, i(); }, m = () => (e = new Promise((i, c) => { if (t.addEventListener("abort", function _() { t.removeEventListener("abort", _), c(o); }), t.aborted) throw o; }), e.catch(u), e), a = () => (b(r) && (r = new AbortController(), t = r.signal, e = m()), f), f = d({ abort: n(l), promise: s(() => e), reason: n(o), refresh: n(a), signal: s(() => t) }); return a(); }; export { w as createAbortable, w as default };