Skip to content

Instantly share code, notes, and snippets.

@richarddd
Created August 12, 2019 05:51
Show Gist options
  • Save richarddd/3d3264e87624f6f264cc7bfa63a58765 to your computer and use it in GitHub Desktop.
Save richarddd/3d3264e87624f6f264cc7bfa63a58765 to your computer and use it in GitHub Desktop.
const counterStore = createStore(
{
count: 0
},
{
increment: ({ count }) => ({ count: count + 1 }),
decrement: ({ count }) => ({ count: count - 1 })
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment