rewow
Declarative state management for React
Counter App using pure function to modify state
import React from 'react';import createStore useStore from 'rewow';const store = ;// an action is pure function, just returns next stateconst Increase = payload state ...state count: statecount + 1;const App = const count dispatch = ; return <> <h1>count</h1> <button =>Increase</button> </> ;;
Using declarative syntax instead of pure state mutating function
import mutate add from 'rewow';const Increase = ;
Conditional state mutating
import mutate add cond from 'rewow';const isEvent = value % 2 === 0;const Increase = ;