Skip to content

Instantly share code, notes, and snippets.

@iazel
Created July 11, 2019 21:20
Show Gist options
  • Save iazel/9bb64ac67e8c93b54f183b22ba4bc205 to your computer and use it in GitHub Desktop.
Save iazel/9bb64ac67e8c93b54f183b22ba4bc205 to your computer and use it in GitHub Desktop.
Composable Reactive UI / Submit with Store
const submit = (store: TodoStore) => (
h('button', sc([
ctext('Add')
props({ className: 'add-todo-submit' }),
onClick((e) => {
e.preventDefault()
store.addTodo(todo.get())
store.getInput().set('')
}),
]))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment