Skip to content

Instantly share code, notes, and snippets.

@iazel
Created July 11, 2019 22:01
Show Gist options
  • Save iazel/58fd7c767154566dce489e2463016579 to your computer and use it in GitHub Desktop.
Save iazel/58fd7c767154566dce489e2463016579 to your computer and use it in GitHub Desktop.
import { h, ht, sc2, children } from '@crui/core'
import { bindChecked } from '@crui/reactive/setups/bind'
const hcc = (tag: Tag, className: string, cs: Component[]) =>
h(tag, sc2(
props({ className }),
children(cs)
))
export const TodoElement = (todo: Todo) => (
hcc('li', 'todo-wrapper', [
hcc('label', 'todo', [
h('input', bindChecked(todo.done)),
ht('span', todo.text),
])
])
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment