Skip to content

Instantly share code, notes, and snippets.

@arnelenero
Last active August 2, 2019 15:22
Show Gist options
  • Save arnelenero/f12f5d2c482dac792dbb02c346eeab32 to your computer and use it in GitHub Desktop.
Save arnelenero/f12f5d2c482dac792dbb02c346eeab32 to your computer and use it in GitHub Desktop.
React Entities example: entities/counter.js
export const initialState = {
value: 0
};
export function increment() {
this.setState({ value: this.state.value + 1 });
}
export function decrement() {
this.setState({ value: this.state.value - 1 });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment