Skip to content

Instantly share code, notes, and snippets.

@MatthiasKainer
Last active July 5, 2020 09:41
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 MatthiasKainer/bb96611a11f54a62d85b23c2fd03e2aa to your computer and use it in GitHub Desktop.
Save MatthiasKainer/bb96611a11f54a62d85b23c2fd03e2aa to your computer and use it in GitHub Desktop.
(element) => {
const { publish, getState } = useState(element, TodoReducer, { todos: [] });
return html`
<button @click="${() => publish("add", "lala")}">
Add value
</button>
<textarea>${getState().join(",")}</textarea>
`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment