Skip to content

Commit

Permalink
example: add HelloWorld component
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkolind committed Nov 27, 2023
1 parent c314373 commit 1e5a2f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
7 changes: 4 additions & 3 deletions example/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { one, createStore, html } from '../dist/one'
import { TodoList, Counter } from './components'
import { createStore, html, one } from '../dist/one'
import { Counter, HelloWorld, TodoList } from './components'

createStore(function () {
return {
Expand All @@ -9,9 +9,10 @@ createStore(function () {

one({
name: 'app',
components: [TodoList, Counter],
components: [TodoList, Counter, HelloWorld],
template: html`
<div>
<hello-world></hello-world>
<todo-list></todo-list>
<counter></counter>
</div>
Expand Down
8 changes: 8 additions & 0 deletions example/components/hello-world/HelloWorld.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { html } from '../../../lib/one';

const HelloWorld = {
name: 'hello-world',
template: html`<h1>Hello World</h1>`,
}

export { HelloWorld }
3 changes: 3 additions & 0 deletions example/components/hello-world/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { HelloWorld } from './HelloWorld'

export { HelloWorld }
2 changes: 2 additions & 0 deletions example/components/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Counter } from './counter'
import { TodoList } from './todo'
import { HelloWorld } from './hello-world'

export {
Counter,
TodoList,
HelloWorld,
}

0 comments on commit 1e5a2f8

Please sign in to comment.