Skip to content

Instantly share code, notes, and snippets.

@mattkenefick
Created June 21, 2017 21:32
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 mattkenefick/8d009a4b550d08047507e01b87ed631e to your computer and use it in GitHub Desktop.
Save mattkenefick/8d009a4b550d08047507e01b87ed631e to your computer and use it in GitHub Desktop.
customElements.define("todo-list", class extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({mode: "open"});
root.innerHTML = `
<ul>
${store().map((todo, index) => `
<li>
<todo-item index=${index}>
${todo}
</todo-item>
</li>
`).join("")}
</ul>
`;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment