Skip to content

Instantly share code, notes, and snippets.

@fay-jai
Created August 8, 2016 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fay-jai/a83b088ecb849e9d09a740fc3c60bc0c to your computer and use it in GitHub Desktop.
Save fay-jai/a83b088ecb849e9d09a740fc3c60bc0c to your computer and use it in GitHub Desktop.
const team1Hoop = createStore( /* ignore the arguments here for now */ );
const twoPointer = {
type: TWO_POINT_SHOT,
payload: {
points: 2
}
};
/*
* The only way to modify the state of your application is by dispatching actions
* to the store.
*/
team1Hoop.dispatch(twoPointer);
/*
* How the state inside the store might look like NOW:
*
* team1Hoop.__applicationState__ = {
* totalPoints: 2,
* playerList: [ list of players on team ]
* };
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment