React hooks library. Simple, yet powerful custom hooks
npm i simple-react-hooks
usePrevious
— return previous prop or state.useStateWithCallback
— return a state and a setter. Callback could be passed and it would be executed after each update.useStateWithCallbackSync
— same as useStateWithCallback, but synchronously.useWatch
— on each update a console.log or a custom fn would be executed.useForceUpdate
— force a component to re-render.useTimeout
— start a timeout that will fire a callback, you could stop it or restart.useInterval
— start an interval that will fire a callback each time delay finish, it could be restarted or stopped.
Feel free to open a PR, or suggest any improvements or new hooks.
Adrián Serrano