Size
0.21 kb
useActions
A simpler and typesafe alternative to useReducer.
Installation
Quick Start
Define how each action modifies the state:
Use the actions in your component:
Build a generic hook
We can leverage typescript generics to build reusable hooks.
Let's build a custom useArray
hook:
We can now use the useArray
hook in our components:
Introduction
one-hook is a carefully crafted collection of React hooks, where each hook does one thing and does it well. Following the Unix philosophy of modularity, each hook is independently packaged and can be installed separately, ensuring minimal bundle size and maximum flexibility.
useAudioAnalyser
Real-time audio analysis based on the Web Audio API.