Objective-Redux on NPM
An intelligent wrapper around redux.
import { StateController } from 'objective-redux';
const initialState = { isOn: false };
export class SwitchStateController extends StateController {
constructor(register) {
super(initialState, register);
}
static getName() {
return 'switch';
}
toggleSwitch = this.registerAction(
(state) => ({ isOn: !state.isOn })
);
setSwitch = this.registerAction(
(state, isOn) => ({ isOn })
);
}
StateSwitch.getInstance(register).toggleSwitch();
For more information, see the documentation or Objective-Redux on NPM.