2.3.0 • Published 2 years ago
flowregime v2.3.0
flowregime
Flowregime is a component that uses hooks+context for state management with React.
Installation
The flowregime package lives in npm. To install the latest stable version, run the following command:
npm i flowregimeOr if you're using yarn:
yarn add flowregimeUsage
There are only two APIs:
StateWrapper
Wrap your components.
<StateWrapper>
<App />
</StateWrapper>useCtrlState
The logic is similar to useState.
const [state,dispatch] = useCtrlState(stateSign,initState)
//eq:
const [count,setCount]= useCtrlState(`MULTI-COUNT`,{num:1})License
Flowregime is MIT licensed.