use-rematch
🕶 A Hook that implement reducer a la Rematch
Instalation
npm install -g use-rematch
or
yarn add use-rematch
Usage
; const model = state: 0 reducers: { return state + 1; } { return state - 1; } async { await ; actions; } ; { const state actions = ; return <div> Value: state <button onClick=actionsincrement>INCREMENT</Button> <button onClick=actionsdecrement>DENCREMENT</button> <button onClick=actionsasyncIncrement>ASYNC INCREMENT</button> </div> ;}