Skip to content

Instantly share code, notes, and snippets.

@bmeurer
Last active March 14, 2017 05:21
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 bmeurer/41ff229f056c900eace1cf052496eee2 to your computer and use it in GitHub Desktop.
Save bmeurer/41ff229f056c900eace1cf052496eee2 to your computer and use it in GitHub Desktop.
const s1 = todo({}, {
type: 'ADD_TODO',
id: 1,
text: "Finish blog post"
});
const s2 = todo(s1, {
type: 'TOGGLE_TODO',
id: 1
});
function render(state) {
return state.id + ": " + state.text;
}
render(s1);
render(s2);
render(s1);
render(s2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment