Skip to content

Instantly share code, notes, and snippets.

@vdsabev
Last active August 15, 2017 13:27
Show Gist options
  • Save vdsabev/3ffd2601e2e89851405728d494e18f0c to your computer and use it in GitHub Desktop.
Save vdsabev/3ffd2601e2e89851405728d494e18f0c to your computer and use it in GitHub Desktop.
Exploring Unidirectional Components in Mithril
const Counter = ({ attrs: { count = 0 } }) => {
const decrement = () => count--;
const increment = () => count++;
return {
view: () => <div>...</div>
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment