0.5.0 • Published 4 years ago
simple-react-hooks v0.5.0
simple-react-hooks
React hooks library. Simple, yet powerful custom hooks
Install
npm i simple-react-hooks
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.
Contributing
Feel free to open a PR, or suggest any improvements or new hooks.
Author
Adrián Serrano
Contact
adrserr@hotmail.com