Skip to content

Commit

Permalink
Merge pull request #10 from biotope/add-default-render
Browse files Browse the repository at this point in the history
Add initial render method
  • Loading branch information
SheepFromHeaven authored Jun 5, 2018
2 parents dc270b0 + 6336c7d commit 3960e3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/component/stateful/component.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ export class {{pascalCase name}} extends HTMLElement {
triggerOnStateChange: (state: {{pascalCase name}}State, lastState: {{pascalCase name}}State) => {}
});
this.uid = this.storeConnector.getComponentId();

this.render(this.storeConnector.getState());
}

render(state: {{properCase name}}State) {
return this.html`{{properCase name}}`;
}
}
if (!customElements.get({{pascalCase name}}.componentName)) {
customElements.define({{pascalCase name}}.componentName, {{pascalCase name}});
Expand Down

0 comments on commit 3960e3d

Please sign in to comment.