@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
14 lines (11 loc) • 362 B
JavaScript
import { useRef } from 'react';
function usePrevious(value, initial) {
const ref = useRef({ target: value, previous: initial });
if (ref.current.target !== value) {
ref.current.previous = ref.current.target;
ref.current.target = value;
}
return ref.current.previous;
}
export { usePrevious as default };
//# sourceMappingURL=usePrevious.js.map