-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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.
joshmanders, EmilTholin, foxylion, martynaskadisa, markerikson and 187 moredashed, ssorallen, vctormb, nasreddineskandrani, GGAlanSmithee and 22 morejeggett, sanderdrummer, emil14, InSuperposition, MrLoh and 7 moreAilrun and luskin
Metadata
Metadata
Assignees
Labels
No labels