behave-react
v1.0.5
Published
![logo](logo.png)
Downloads
11
Readme
React Behave
Behave is a simple React Redux wrapper for both React TS & Native. The goal is to setup a redux store complete with async saga and loaders handler in less then a minute.
Setup
Installation is a one-liner once you added the library
Create the Store
In your src/store/
folder create a index.tsx
file that looks like this:
import { behaveStore, poolReducer, combineReducers } from 'behave-react'
const reducers = combineReducers({ ...poolReducer() })
const { store, persistor } = behaveStore({ reducers: reducers })
export type RootState = ReturnType<typeof reducers>
export default store
Adding Reducers
As in vanilla redux you can create your own reducers
import { behaveStore, poolReducer, combineReducers } from 'behave-react'
const reducers = combineReducers({ ...poolReducer() })
const { store, persistor } = behaveStore({ reducers: reducers })
export type RootState = ReturnType<typeof reducers>
export default store