flowregime
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

flowregime

Flowregime is a component that uses hooks+context for state management with React.

npm bundle size GitHub https://github.com/NickLJudy/flowregime/commits/main

Installation

The flowregime package lives in npm. To install the latest stable version, run the following command:

npm i flowregime

Or if you're using yarn:

yarn add flowregime

Usage

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.

Package Sidebar

Install

npm i flowregime

Weekly Downloads

2

Version

2.3.0

License

MIT

Unpacked Size

41.5 kB

Total Files

13

Last publish

Collaborators

  • galenyoung