Skip to content

Instantly share code, notes, and snippets.

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