UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

14 lines 468 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("react"); exports.default = (value, enabled, onChange) => { const ref = (0, react_1.useRef)(); (0, react_1.useEffect)(() => { if (enabled && ref.current !== value) { ref.current = value; onChange(value); } }, [value, enabled, onChange]); return ref.current; }; //# sourceMappingURL=usePreviousValueChange.js.map