Closed
Description
Today's the big day for React Hooks!
Assuming the API gets released, we should provide some hooks. Something like useRedux
would be cool!
import * as actions from './actions'
function Counter() {
const [count, {increment, decrement}] = useRedux(state => state.count, actions);
return (
<>
Count: {count}
<button onClick={() => increment()}>+</button>
<button onClick={() => decrement()}>-</button>
</>
);
}
Note: Yes, I'm aware of useReducer
. That is for a Redux-style reducer, but for a local component's state only. What we're building would be for the store's global state, using useContext
under the hood.
Metadata
Metadata
Assignees
Labels
No labels