UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

14 lines 434 B
import { useRef, useEffect } from 'react'; /** * This is for compare a previous value with the current value. For example a value of prevPops vs props * @param value the value need to store * @returns the current value of a ref */ export var usePrevious = function (value) { var ref = useRef(); useEffect(function () { ref.current = value; }); return ref.current; }; //# sourceMappingURL=usePrevious.js.map