useReducer<T, A> function
Creates a reducer-style state manager.
Implementation
Reactive<T> useReducer<T, A>(
T initialState, T Function(T state, A action) reducer) {
final state = Reactive<T>(initialState);
void dispatch(A action) {
state.value = reducer(state.value, action);
}
// Attach dispatch function to the reactive state
(state as dynamic).dispatch = dispatch;
return state;
}