Last active
August 2, 2019 15:22
-
-
Save arnelenero/f12f5d2c482dac792dbb02c346eeab32 to your computer and use it in GitHub Desktop.
React Entities example: entities/counter.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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