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)

15 lines (14 loc) 458 B
import { useCallback as f, useState as i, useRef as p, useEffect as b } from "../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; function l(e, t) { const s = f(() => e.getValue(t), [e, t]), [r, n] = i(() => s()), a = p(r); return b(() => { const c = () => { const u = s(); a.current !== u && (a.current = u, n(u)); }; return c(), e.subscribe(c); }, [e, s, t]), r; } export { l as useWatch };