-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated for derivative state prototype
- Loading branch information
1 parent
6ae1e8e
commit 06bf2b7
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const inferredObservability = true; | ||
|
||
export default class BadgeComponent extends HTMLElement { | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.counter = 0; | ||
} | ||
|
||
connectedCallback() { | ||
this.render(); | ||
} | ||
|
||
render() { | ||
const { counter } = this; | ||
const condition = ` (${counter % 2 === 0 ? 'even' : 'odd'}) `; | ||
// const conditionalClass = ` (${predicate ? 'even' : 'odd'}) `; | ||
// const conditionalText = predicate ? ' 🥳' : ''; | ||
|
||
// TODO <span class={conditionalClass}>{counter}<span>{conditionalText}</span></span> | ||
// should have attr AND text instructions | ||
// though technically conditionalClass should only observe off predicate | ||
return ( | ||
<span><span>{counter}</span><span>{condition}</span></span> | ||
); | ||
} | ||
} | ||
|
||
customElements.define('wcc-badge', BadgeComponent); |
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
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