Skip to content

Commit

Permalink
Install latest signals library, tweak playground sample
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani committed Oct 7, 2024
1 parent 309ac12 commit d42520b
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 74 deletions.
169 changes: 99 additions & 70 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/lit-dev-content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"@lit-labs/motion": "^1.0.1",
"@lit-labs/react": "^1.0.8",
"@lit-labs/task": "^3.0.2",
"@lit-labs/signals": "^0.1.0",
"@lit-labs/signals": "^0.1.1",
"@lit/context": "^1.1.0",
"@lit/localize": "^0.10.0",
"@lit/react": "^1.0.0 || 1.0.0-pre.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/lit-dev-content/samples/examples/signals/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<script type="module" src="./shared-counter.js"></script>

<body>
<shared-counter></shared-counter>
<shared-counter></shared-counter>
<shared-counter><h2>Instance 1</h2></shared-counter>
<shared-counter><h2>Instance 2</h2></shared-counter>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ export class SharedCounterComponent extends SignalWatcher(LitElement) {
display: block;
border: solid 1px lightgray;
margin: 8px;
padding: 8px;
}
button {
background: lightgreen
}
`;

render() {
return html`
<p>The count is ${watch(count)}</p>
<slot></slot>
<p>count = ${watch(count)}</p>
<button @click=${this.#onClick}>Increment</button>
`;
}
Expand Down

0 comments on commit d42520b

Please sign in to comment.