Skip to content

Commit

Permalink
ci(js-lib): add missing new keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jun 5, 2024
1 parent 557d1c4 commit 0a1bf78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion js-lib/examples/cdn/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ <h1>Welcome to My Trame Client</h1>
<button class="subtract">Subtract</button>
<div class="count">from HTML</div>
</main>
<script crossorigin="anonymous" src="https://www.unpkg.com/@kitware/trame@0.0.1/dist/trame.umd.js"></script>
<script crossorigin="anonymous" src="https://www.unpkg.com/@kitware/trame/dist/trame.umd.js"></script>
<script>
const trame = new Trame();
trame.connect().then((config) => {
console.log(config);

trame.state.watch(["count"], (count) => {
document.querySelector(".count").innerHTML = count;
});
document.querySelector(".add").addEventListener("click", () => trame.trigger("add"));
document.querySelector(".subtract").addEventListener("click", () => trame.trigger("subtract"));
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion js-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kitware/trame",
"version": "0.0.2",
"version": "0.0.3",
"license": "MIT",
"main": "./dist/trame.umd.js",
"unpkg": "./dist/trame.umd.js",
Expand Down
4 changes: 2 additions & 2 deletions js-lib/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class State {
this._mtime = 0;
this._ready = false;
this._listeners =
oldState?._listeners || ListenerManager("trame state change");
this._watchers = oldState?._watchers || WatcherManager();
oldState?._listeners || new ListenerManager("trame state change");
this._watchers = oldState?._watchers || new WatcherManager();
this._subscriptions = [];
this._wslinkSubscriptions = [];
this._subscriptions.push(
Expand Down

0 comments on commit 0a1bf78

Please sign in to comment.