UNPKG

swagger-editor

Version:

- [Anonymized analytics](#anonymized-analytics) - [Getting started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Development](#development) - [Prerequisites](#prerequisites) - [Setting

30 lines (29 loc) 712 B
import { useEffect as e, useRef as t } from "react"; //#region src/plugins/props-change-watcher/actions.ts var n = "EDITOR_PROP_CHANGED", r = { statePlugins: { editor: { actions: { propChanged: (e, t, r) => ({ type: n, payload: e, meta: { newValue: t, oldValue: r } }) } } } }, i = (n, r) => { let i = t(!0), a = t(n); e(() => { i.current ? i.current = !1 : a.current !== n && r(n, a.current), a.current = n; }, [n, r]); }, a = () => { let e = t(null); return { plugin(t) { return e.current = t.getSystem(), r; }, getSystem() { return e.current; } }; }, o = () => r; o.usePropChange = i, o.useMountPlugin = a; //#endregion export { o as default }; //# sourceMappingURL=index.js.map