@windypro-rourou/dsh-logcat 0.6.0-preview.2 → 0.6.0-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +12 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -148,9 +148,19 @@ window.__ModuleLoader__.load({
148
148
  constructor() {
149
149
  this.panelOpen = false;
150
150
  this.listeners = new Set();
151
+ this._snap = { panelOpen: false };
152
+ // Bound as instance arrow properties: useSyncExternalStore calls them
153
+ // WITHOUT a receiver, so prototype methods would lose `this` (white
154
+ // panel). Arrow properties also give stable references.
155
+ this.getSnapshot = () => {
156
+ if (this._snap.panelOpen !== this.panelOpen) this._snap = { panelOpen: this.panelOpen };
157
+ return this._snap;
158
+ };
159
+ this.subscribe = (fn) => {
160
+ this.listeners.add(fn);
161
+ return () => { this.listeners.delete(fn); };
162
+ };
151
163
  }
152
- getSnapshot() { return { panelOpen: this.panelOpen }; }
153
- subscribe(fn) { this.listeners.add(fn); return () => { this.listeners.delete(fn); }; }
154
164
  open() { if (this.panelOpen) return; this.panelOpen = true; this.notify(); }
155
165
  close() { if (!this.panelOpen) return; this.panelOpen = false; this.notify(); }
156
166
  toggle() { if (this.panelOpen) this.close(); else this.open(); }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@windypro-rourou/dsh-logcat",
3
3
  "description": "Android Logcat viewer for the dsh web GUI: auto-connects to any adb device in debug mode, live logcat stream with level/keyword filters, pause/clear/export, plus agent tools (logcat_recent). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules copy, no dsh source changes.",
4
- "version": "0.6.0-preview.2",
4
+ "version": "0.6.0-preview.3",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "engines": {