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)

32 lines (31 loc) 944 B
import { getter as p } from "../../../utils/struct/property.js"; import { isFunction as c, isNullish as u } from "../../../utils/value/is.js"; import { struct as n } from "../../../utils/struct/main.js"; import { noop as f } from "../../../utils/common.js"; const b = (t) => { const o = {}, r = Object.getOwnPropertyDescriptors(t); for (const e of Object.keys(t)) { const { get: i, value: s } = r[e]; o[e] = p( i || (c(s) ? ( // ensure that the `this` binding of the getter function is preserved s.bind(t) ) : () => s) ); } return n(o); }, d = () => { const t = { idle: null, resume: null }, o = {}; for (const r of Object.keys(t)) o[r] = { get: () => t[r] ?? f, set: (e) => { u(e) ? t[r] = null : c(e) && e !== t[r] && (t[r] = e); } }; return n(o); }; export { b as createWatchListCurrentStateRecord, d as createWatchListSubscriptionEventCallbacks };