UNPKG

@coin-voyage/paykit

Version:

Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.

11 lines 385 B
import { useRef } from "react"; export default function usePrevious(value, initial) { const ref = useRef({ target: value, previous: initial }); if (ref.current.target !== value) { // The value changed. ref.current.previous = ref.current.target; ref.current.target = value; } return ref.current.previous; } //# sourceMappingURL=usePrevious.js.map