Usage with React
Installing React event-flux
npm install --save react-event-fluxBasic Example
import { StoreBase } from "event-flux";
export default class CounterStore extends StoreBase {
constructor(appStore) {
super(appStore);
this.state = { counter: 0 };
}
increment() {
this.setState({ counter: this.state.counter + 1 });
}
decrement() {
this.setState({ counter: this.state.counter - 1 });
}
}Last updated
Was this helpful?