Last active
July 8, 2016 14:27
-
-
Save trueadm/6aa37eb6cfe97cd0d12a2848d19b1f33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { render, createView, html } from 'fusion'; | |
const view = createView(({ name, age, location }) => html` | |
<div> | |
<header>About me</header> | |
<section class="about"> | |
<div>My name: <span>${ name }</span></div> | |
<div>My age: <span>${ age }</span></div> | |
<div>My location: <span>${ location }</span></div> | |
</section> | |
</div> | |
`); | |
render(view('Dominic', 28, 'UK'), document.body); | |
const MyComponent = createComponent(function (props) { | |
return html`<div>Hello world</div>`; | |
}); | |
render(html` | |
<div> | |
${ MyComponent({ items, counter }, | |
MyComponent({ items, counter }), | |
MyComponent({ items, counter }), html` | |
<div>Foo</div> | |
<div>Foo</div> | |
`)} | |
</div> | |
`, document.body); | |
render(html` | |
import MyComponent from ${ MyComponent }; | |
<div> | |
<MyComponent>, | |
<MyComponent /> | |
<MyComponent /> | |
<div>Foo</div> | |
<div>Foo</div> | |
</MyComponent> | |
</div> | |
`, document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment