Skip to content

Commit

Permalink
[update]
Browse files Browse the repository at this point in the history
  • Loading branch information
木瓜丸 committed Dec 3, 2020
1 parent 7401ccb commit 3dd0ebd
Show file tree
Hide file tree
Showing 10 changed files with 3,644 additions and 227 deletions.
90 changes: 1 addition & 89 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/onigiri.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</head>
<body>
<test-component></test-component>
<script src='main.js'></script>
<script src='main.js' type='module'></script>
</body>
</html>
54 changes: 32 additions & 22 deletions examples/main.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions examples/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {Component, html} from '../../dist/onigiri.js';

class TestComponent extends Component {
init() {
return {
attr: 'hello',
content: 'control'
}
}
update(state) {
return {
attr: state.attr + 'e',
content: state.content + 'c'
}
}
render(state) {
return html`
<div id=${state.attr} @click=${e => this.dispatch('update')}>
${state.content}
</div>
`;
}
}

customElements.define('test-component', TestComponent);
Loading

0 comments on commit 3dd0ebd

Please sign in to comment.