UNPKG

@rtbjs/use-state

Version:

`@rtbjs/use-state` is a state management tool that can act as a local state and be easily turned into a global redux state. It is an innovative approach to state management that combines the advantages of both React's useState and Redux's state management

9 lines 256 B
import { useRef, useEffect } from 'react'; export var usePrevious = function (value) { var ref = useRef(value); useEffect(function () { ref.current = value; }, [value]); return ref.current; }; //# sourceMappingURL=usePrevious.js.map