use-redux-react-context
v1.0.0-alpha
Published
Simple utility to create TS typed hook on redux store for react
Downloads
1
Readme
hoodash
Install
npm install use-redux-react-context
Simple usage
// store.js
import createStoreHook from 'use-redux-react-context';
const store = createStore(reducer);
const { useSelector } = createStoreHook(store);
// Component.js
import { useSelector } from './store';
const selector = state => state.some.field;
const Consumer = () => {
const value = useSelector(selector);
return <div>{value}</div>;
};
Use with Typescript
- Supports Typescript
Why hoodash?
- Simple Utility function
Alpha
- In Testing mode