informa 3.1.0 → 4.0.0

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 (48) hide show
  1. package/README.md +171 -184
  2. package/dist/EnumerableWeakSet.d.ts +10 -0
  3. package/dist/EnumerableWeakSet.d.ts.map +1 -0
  4. package/dist/EnumerableWeakSet.js +44 -0
  5. package/dist/EnumerableWeakSet.js.map +1 -0
  6. package/dist/high.d.ts +2 -3
  7. package/dist/high.d.ts.map +1 -1
  8. package/dist/high.js +1 -2
  9. package/dist/high.js.map +1 -1
  10. package/dist/internals.d.ts +3 -0
  11. package/dist/internals.d.ts.map +1 -1
  12. package/dist/internals.js +5 -2
  13. package/dist/internals.js.map +1 -1
  14. package/dist/low.d.ts +16 -0
  15. package/dist/low.d.ts.map +1 -1
  16. package/dist/low.js +150 -0
  17. package/dist/low.js.map +1 -1
  18. package/dist/quirks/array.d.ts +4 -3
  19. package/dist/quirks/array.d.ts.map +1 -1
  20. package/dist/quirks/array.js +163 -75
  21. package/dist/quirks/array.js.map +1 -1
  22. package/dist/quirks/basestatified.d.ts +24 -2
  23. package/dist/quirks/basestatified.d.ts.map +1 -1
  24. package/dist/quirks/basestatified.js +244 -83
  25. package/dist/quirks/basestatified.js.map +1 -1
  26. package/dist/quirks/basestatified.test.d.ts +9 -0
  27. package/dist/quirks/basestatified.test.d.ts.map +1 -0
  28. package/dist/quirks/basestatified.test.js +291 -0
  29. package/dist/quirks/basestatified.test.js.map +1 -0
  30. package/dist/quirks/map.d.ts.map +1 -1
  31. package/dist/quirks/map.js +1 -0
  32. package/dist/quirks/map.js.map +1 -1
  33. package/dist/quirks/set.d.ts.map +1 -1
  34. package/dist/quirks/set.js +1 -0
  35. package/dist/quirks/set.js.map +1 -1
  36. package/dist/test.js +2 -6
  37. package/dist/test.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/EnumerableWeakSet.ts +46 -0
  40. package/src/high.ts +2 -3
  41. package/src/internals.ts +5 -1
  42. package/src/low.ts +120 -1
  43. package/src/quirks/array.ts +168 -92
  44. package/src/quirks/basestatified.test.ts +375 -0
  45. package/src/quirks/basestatified.ts +294 -117
  46. package/src/quirks/map.ts +3 -1
  47. package/src/quirks/set.ts +3 -1
  48. package/src/test.ts +13 -15
@@ -1,163 +1,340 @@
1
+ import { EnumerableWeakMap } from "../EnumerableWeakMap.js";
2
+ import { EnumerableWeakSet } from "../EnumerableWeakSet.js";
1
3
  import {
2
4
  exitProxySymbol,
3
5
  getMetadataOf,
4
6
  getGlobalStateMode,
7
+ isStatified,
8
+ metadataMap,
5
9
  setMetadataOf,
6
10
  statifySealKey,
7
11
  type Statify,
8
12
  } from "../internals.js";
9
13
  import {
10
14
  emitDescendantPathEvents,
15
+ emitCollectionTransition,
11
16
  extract,
12
17
  hook,
18
+ registerPreExtractionHook,
13
19
  StateMetadata,
14
20
  unhook,
15
- type ExitProxyValue,
16
21
  type StatifiableObj,
17
22
  } from "../low.js";
18
23
 
19
24
  type ClassType<T extends any[] = any[], U = object> = new (...args: T) => U;
20
- const classMapMemo = new WeakMap<ClassType, ClassType>();
21
25
 
22
- const blanketProtoMemo = new WeakMap<object, object>();
23
- const blanketProtoSet = new WeakSet<object>();
26
+ // Classes whose instances have been constructed but not yet field-instrumented.
27
+ const pendingAssemblies = new EnumerableWeakSet<object>();
28
+
29
+ // Map from a still-pending child instance → list of (parentMetadata, prop) pairs
30
+ // that need hook() called once the child is reconciled.
31
+ const deferredHooks = new EnumerableWeakMap<object, { metadata: StateMetadata; prop: string | symbol }[]>();
32
+
33
+ // One shim proxy per outermost constructor (new.target).
34
+ const shimCache = new WeakMap<Function, object>();
35
+
36
+ function getPrototypeChainDescriptor(
37
+ obj: object,
38
+ prop: string | symbol,
39
+ ): PropertyDescriptor | undefined {
40
+ let curr: object | null = obj;
41
+ while (curr !== null) {
42
+ const desc = Object.getOwnPropertyDescriptor(curr, prop);
43
+ if (desc) return desc;
44
+ curr = Object.getPrototypeOf(curr);
45
+ }
46
+ return undefined;
47
+ }
24
48
 
25
- function getBlanketPrototype(actualProto: object) {
26
- const maybeMemoed = blanketProtoMemo.get(actualProto);
27
- if (maybeMemoed) return maybeMemoed;
49
+ const shimHandler: ProxyHandler<object> = {
50
+ get(target, prop, recv) {
51
+ // Always signal that this object is statified.
52
+ if (prop === statifySealKey) return true;
28
53
 
29
- const storage = Object.create(actualProto) as {
30
- [statifySealKey]: true;
31
- [exitProxySymbol]: ExitProxyValue;
32
- };
33
- // storage[statifySealKey] = true;
54
+ if (getGlobalStateMode() === "extract-proxy-path") {
55
+ // Root-level exit: this instance IS the stateRoot.
56
+ if (prop === exitProxySymbol) {
57
+ return { path: [], stateRoot: recv as Statify<StatifiableObj> };
58
+ }
34
59
 
35
- const blanket = new Proxy(storage, {
36
- get(target, prop, recv) {
37
- if (prop === statifySealKey) return true;
60
+ // Safety net: reconcile if somehow still pending at extraction time.
61
+ if (pendingAssemblies.has(recv as object)) {
62
+ reconcileInstance(recv as object);
63
+ }
38
64
 
39
- if (getGlobalStateMode() === "extract-proxy-path") {
40
- if (prop === exitProxySymbol) {
41
- return { path: [], stateRoot: recv as Statify<StatifiableObj> };
42
- }
65
+ // Forward to extract() so the path is captured.
66
+ // Own accessor properties on recv are already handling extract-proxy-path
67
+ // themselves; the shim is only reached for prototype-level props.
68
+ return extract(
69
+ Reflect.get(target, prop, recv),
70
+ recv as Statify<StatifiableObj>,
71
+ [prop],
72
+ );
73
+ }
43
74
 
44
- return extract(undefined, recv as Statify<StatifiableObj>, [prop]);
45
- }
75
+ return Reflect.get(target, prop, recv);
76
+ },
77
+
78
+ set(target, prop, newVal, recv) {
79
+ // This trap fires only when `prop` is NOT an own property of `recv`.
80
+ // That covers:
81
+ // (a) Pre-reconciliation field initializer writes → create own data prop.
82
+ // (b) Prototype accessor writes (e.g. `get state()` / `set state()`).
83
+ // (c) Genuinely new dynamic property additions.
84
+ //
85
+ // Own accessor properties installed by reconcileInstance are handled
86
+ // by their own setters and never reach here.
46
87
 
47
- return Reflect.get(target, prop, recv);
48
- },
88
+ // Check for a prototype-level accessor setter BEFORE calling Reflect.set.
89
+ const protoDesc = getPrototypeChainDescriptor(target, prop);
49
90
 
50
- set(target, prop, newVal, recv) {
91
+ // Delegate the actual assignment.
92
+ const result = Reflect.set(target, prop, newVal, recv);
93
+
94
+ // If this was a prototype accessor write and the instance has metadata,
95
+ // emit replacement events so subscribers fire.
96
+ if (result && protoDesc?.set && metadataMap.has(recv as Statify<StatifiableObj>)) {
51
97
  const stateMetadata = getMetadataOf(recv as Statify<StatifiableObj>);
98
+ stateMetadata.emit("replaceProp", newVal, prop);
99
+ const ee = stateMetadata.eventEmitterAtPathMaybe([prop]);
100
+ if (ee) {
101
+ ee.emit("replace", newVal);
102
+ emitDescendantPathEvents(stateMetadata, [prop], newVal, true);
103
+ }
104
+ }
52
105
 
53
- const had = Reflect.has(recv, prop);
54
- const oldVal = Reflect.get(recv, prop) as unknown;
106
+ return result;
107
+ },
108
+
109
+ has(target, prop) {
110
+ if (prop === statifySealKey || prop === exitProxySymbol) return true;
111
+ return Reflect.has(target, prop);
112
+ },
113
+ };
114
+
115
+ function getOrCreateShim(ctor: Function): object {
116
+ const cached = shimCache.get(ctor);
117
+ if (cached) return cached;
118
+
119
+ // shimTarget's [[Prototype]] = ctor.prototype, so the full chain is:
120
+ // instance → shim → shimTarget → ctor.prototype → … → Superclass.prototype
121
+ // This preserves instanceof for all classes in the chain.
122
+ const shimTarget = Object.create((ctor as ClassType).prototype) as object;
123
+ const shim = new Proxy(shimTarget, shimHandler);
124
+ shimCache.set(ctor, shim);
125
+ return shim;
126
+ }
55
127
 
56
- const result = Reflect.set(target, prop, newVal, recv);
128
+ /**
129
+ * Converts all enumerable, configurable own data properties of `instance` into
130
+ * accessor-backed reactive properties connected to `instance`'s StateMetadata.
131
+ *
132
+ * Idempotent: returns immediately if the instance is not in pendingAssemblies.
133
+ */
134
+ function reconcileInstance(instance: object): void {
135
+ if (!pendingAssemblies.has(instance)) return;
136
+ pendingAssemblies.delete(instance);
137
+
138
+ // Drain any deferred hooks where this instance was the pending child.
139
+ const deferred = deferredHooks.get(instance);
140
+ if (deferred) {
141
+ deferredHooks.delete(instance);
142
+ const childMetadata = getMetadataOf(instance as Statify<StatifiableObj>);
143
+ for (const { metadata: parentMetadata, prop } of deferred) {
144
+ hook(parentMetadata, prop, childMetadata);
145
+ }
146
+ }
147
+
148
+ // Metadata was installed eagerly in ExtractionShimBase's constructor.
149
+ const metadata = getMetadataOf(instance as Statify<StatifiableObj>);
150
+
151
+ const isArray = Array.isArray(instance);
152
+
153
+ const props: (string | symbol)[] = [
154
+ ...Object.getOwnPropertyNames(instance),
155
+ ...Object.getOwnPropertySymbols(instance),
156
+ ];
157
+
158
+ for (const prop of props) {
159
+ // Skip Informa internal symbols.
160
+ if (prop === statifySealKey || prop === exitProxySymbol) continue;
161
+
162
+ // Skip array numeric indices — managed by the array's own push/pop/splice overrides.
163
+ if (isArray && typeof prop === "string" && Number.isInteger(Number(prop))) continue;
164
+
165
+ const desc = Object.getOwnPropertyDescriptor(instance, prop)!;
166
+
167
+ // Non-configurable: cannot be redefined; leave non-reactive.
168
+ // Note: these properties retain their value but won't participate in the
169
+ // observable graph. This is intentional and tested.
170
+ if (!desc.configurable) continue;
171
+
172
+ // Existing accessor (get/set): do not double-wrap.
173
+ if ("get" in desc || "set" in desc) continue;
174
+
175
+ // ---- Instrument this configurable data property ----
176
+ let value: unknown = desc.value;
177
+
178
+ // Hook the initial value if it is itself statified.
179
+ if (
180
+ value != null &&
181
+ typeof value === "object" &&
182
+ isStatified(value as StatifiableObj)
183
+ ) {
184
+ if (pendingAssemblies.has(value as object)) {
185
+ // The nested value is itself pending (constructed during this constructor
186
+ // but not yet reconciled — its metadata doesn't exist yet). Defer the
187
+ // hook: it will be wired once reconcileInstance runs for that child.
188
+ deferredHooks.getOrInsertComputed(value as object, () => []).push({ metadata, prop });
189
+ } else {
190
+ hook(metadata, prop, getMetadataOf(value as Statify<StatifiableObj>));
191
+ }
192
+ }
57
193
 
58
- try {
59
- if (result) {
194
+ Object.defineProperty(instance, prop, {
195
+ get(this: object) {
196
+ if (getGlobalStateMode() === "extract-proxy-path") {
197
+ return extract(value, this as Statify<StatifiableObj>, [prop]);
198
+ }
199
+ return value;
200
+ },
201
+
202
+ set(this: object, next: unknown) {
203
+ const old = value;
204
+ value = next;
205
+
206
+ if (old !== next) {
60
207
  if (
61
- typeof newVal === "object"
62
- && newVal != null
63
- && (newVal as any)[statifySealKey]
208
+ old != null &&
209
+ typeof old === "object" &&
210
+ isStatified(old as StatifiableObj)
64
211
  ) {
65
- hook(
66
- stateMetadata,
67
- prop,
68
- getMetadataOf(newVal as Statify<StatifiableObj>),
69
- );
212
+ unhook(metadata, prop, getMetadataOf(old as Statify<StatifiableObj>));
70
213
  }
71
214
 
72
- if (had) {
73
- if (
74
- oldVal !== newVal
75
- && typeof oldVal === "object"
76
- && oldVal != null
77
- && (oldVal as any)[statifySealKey]
78
- ) {
79
- unhook(
80
- stateMetadata,
81
- prop,
82
- getMetadataOf(oldVal as Statify<StatifiableObj>),
83
- );
84
- }
85
-
86
- stateMetadata.emit("replaceProp", newVal, prop);
215
+ if (
216
+ next != null &&
217
+ typeof next === "object" &&
218
+ isStatified(next as StatifiableObj)
219
+ ) {
220
+ hook(metadata, prop, getMetadataOf(next as Statify<StatifiableObj>));
87
221
  }
88
222
 
89
- stateMetadata.emit("setProp", newVal, prop);
90
-
91
- const maybeEventEmitterAtPath = stateMetadata.eventEmitterAtPathMaybe([prop]);
92
- if (maybeEventEmitterAtPath) {
93
- if (had) {
94
- maybeEventEmitterAtPath.emit("replace", newVal);
95
- }
96
-
97
- maybeEventEmitterAtPath.emit("set", newVal);
98
-
99
- emitDescendantPathEvents(
100
- stateMetadata,
101
- [prop],
102
- newVal,
103
- had,
104
- );
105
- }
223
+ emitCollectionTransition(old, next);
106
224
  }
107
- } finally {
108
- return result;
109
- }
110
- },
111
-
112
- has(target, prop) {
113
- if (getGlobalStateMode() === "extract-proxy-path" && prop === exitProxySymbol) {
114
- return true;
115
- }
116
-
117
- return Reflect.has(target, prop);
118
- },
119
- });
120
225
 
121
- blanketProtoMemo.set(actualProto, blanket);
122
- blanketProtoSet.add(blanket);
226
+ // Enter the existing replacement machinery — same path as statifyObject's
227
+ // set trap in low.ts. "listen → replace → fire" is preserved because this
228
+ // accessor is installed before any external mutation can reach the field.
229
+ metadata.emit("replaceProp", next, prop);
123
230
 
124
- return blanket;
231
+ const ee = metadata.eventEmitterAtPathMaybe([prop]);
232
+ if (ee) {
233
+ ee.emit("replace", next);
234
+ emitDescendantPathEvents(metadata, [prop], next, true);
235
+ }
236
+ },
237
+
238
+ enumerable: desc.enumerable ?? true,
239
+ configurable: true,
240
+ });
241
+ }
242
+
243
+ // Selector/stateRoot identity: verified correct. Every on*()/off*() call goes
244
+ // through selectorToRootAndPath(), which fires preExtractionHooks() before
245
+ // entering extract-proxy-path mode. The preExtractionHook registered below
246
+ // reconciles all pending instances first — so by the time the selector function
247
+ // runs, every pending `this.x` field is already an accessor that returns
248
+ // extract(value, this, ['x']). Path chains like `() => this.a.b.c` are therefore
249
+ // built up correctly, and stateRoot is the raw instance, which is the same object
250
+ // keyed in metadataMap. No re-mapping needed.
125
251
  }
126
252
 
127
- export function makeStatified<
128
- V extends ClassType<T, U>,
129
- T extends any[],
130
- U extends object,
253
+ // Before selectorToRootAndPath enters extract-proxy-path mode it calls all
254
+ // registered hooks. This hook reconciles every pending instance so that their
255
+ // own data properties are already accessor-backed when the selector runs.
256
+
257
+ registerPreExtractionHook(() => {
258
+ // Snapshot: reconcileInstance removes from pendingAssemblies, which mutates
259
+ // the set during iteration — take a copy first.
260
+ const snapshot = [...pendingAssemblies];
261
+ for (const instance of snapshot) {
262
+ reconcileInstance(instance);
263
+ }
264
+ });
265
+
266
+ /**
267
+ * Wraps a user-defined class factory in the Informa observable lifecycle.
268
+ *
269
+ * Usage:
270
+ * ```ts
271
+ * const MyClass = statifyClass(
272
+ * (Base) => class MyClass extends Base {
273
+ * name = "default";
274
+ * constructor(name: string) { super(); this.name = name; }
275
+ * },
276
+ * Object,
277
+ * );
278
+ * ```
279
+ *
280
+ * Construction lifecycle:
281
+ * 1. ExtractionShimBase constructor runs → metadata installed, shim set as prototype.
282
+ * 2. UserSubclass field initializers run → own data properties created on instance.
283
+ * 3. UserSubclass constructor body runs.
284
+ * 4. Instance is in pendingAssemblies (field instrumentation deferred).
285
+ * 5. On first `on()`/`off()` call → registerPreExtractionHook fires → reconcileInstance
286
+ * converts own data properties to reactive accessor-backed properties.
287
+ */
288
+ export function statifyClass<
289
+ SubclassType extends ClassType<ArgsSub, OutSub>,
290
+ ArgsSub extends any[],
291
+ OutSub extends object,
292
+ SuperclassType extends ClassType<ArgsSuper, OutSuper>,
293
+ ArgsSuper extends any[],
294
+ OutSuper extends object,
131
295
  >(
132
- OriginalClass: V,
133
- ): V {
134
- const maybeMemoed = classMapMemo.get(OriginalClass);
135
- if (maybeMemoed) return maybeMemoed as V;
136
-
137
- // @ts-ignore - ts-2545 "A mixin class must have a constructor with a single rest parameter of type 'any[]'."
138
- class Statified extends OriginalClass {
139
- constructor(...args: T) {
140
- super(...args);
141
-
142
- const ctor = new.target ?? Statified;
143
- const inst = Reflect.construct(OriginalClass, args, ctor) as Statify<U>;
144
-
145
- setMetadataOf(inst, new StateMetadata());
146
-
147
- const actualProto = ctor.prototype;
148
- const finalProto = blanketProtoSet.has(actualProto)
149
- ? actualProto
150
- : getBlanketPrototype(actualProto);
151
-
152
- Reflect.setPrototypeOf(inst, finalProto);
296
+ makeSubclass: (SuperclassIn: SuperclassType) => SubclassType,
297
+ Superclass: SuperclassType,
298
+ ): SubclassType & ClassType<ArgsSub, Statify<OutSub>> {
299
+
300
+ // ExtractionShimBase sits between Superclass and the user's class.
301
+ // Its constructor:
302
+ // - Installs StateMetadata on the instance eagerly (so subclasses like
303
+ // StatifiedArray can call getMetadataOf() from their constructor bodies).
304
+ // - Marks the instance as pending for lazy field instrumentation.
305
+ // - Inserts the shim proxy as the instance's [[Prototype]], enabling
306
+ // statifySealKey / exitProxySymbol / extract-proxy-path handling.
307
+ //
308
+ // Guard: in nested statifyClass chains (e.g. statifyClass(..., A) where A
309
+ // was itself produced by statifyClass), multiple ExtractionShimBase
310
+ // constructors run. The guard ensures setup happens exactly once — at the
311
+ // innermost (deepest) ExtractionShimBase call.
312
+ class ExtractionShimBase extends (Superclass as unknown as typeof Object) {
313
+ constructor(...args: any[]) {
314
+ super(...(args as []));
315
+
316
+ if (!pendingAssemblies.has(this)) {
317
+ setMetadataOf(
318
+ this as unknown as Statify<StatifiableObj>,
319
+ new StateMetadata(),
320
+ );
321
+ pendingAssemblies.add(this);
322
+ }
153
323
 
154
- return inst;
324
+ // Always update the shim to match the outermost constructor (new.target).
325
+ // In nested chains the innermost ExtractionShimBase sets the shim first;
326
+ // subsequent (shallower) ones overwrite it with the same value since
327
+ // new.target propagates as the outermost class throughout the chain.
328
+ const ctor = (new.target ?? ExtractionShimBase) as Function;
329
+ Reflect.setPrototypeOf(this, getOrCreateShim(ctor));
155
330
  }
156
- };
157
-
158
- classMapMemo.set(OriginalClass, Statified);
159
-
160
- return Statified;
331
+ }
332
+
333
+ // Invoke the user's factory with the shim base, then return the result.
334
+ // No outer Statified wrapper is needed: field instrumentation is lazy,
335
+ // triggered by registerPreExtractionHook before any selectorToRootAndPath call.
336
+ return makeSubclass(
337
+ ExtractionShimBase as unknown as SuperclassType,
338
+ ) as unknown as SubclassType & ClassType<ArgsSub, Statify<OutSub>>;
161
339
  }
162
340
 
163
- export const BaseStatified = makeStatified(Object);
package/src/quirks/map.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { exitProxySymbol, getGlobalStateMode, setMetadataOf, Statify, statifySealKey } from "../internals.js";
1
+ import { exitProxySymbol, getGlobalStateMode, isStatifiedMapKey, setMetadataOf, Statify, statifySealKey } from "../internals.js";
2
2
  import { ExitProxyValue, StateMetadata, StatifiableObj } from "../low.js";
3
3
 
4
4
  export class StatifiedMap<K, V> extends Map<K, V> implements Statify<Map<K, V>> {
@@ -58,3 +58,5 @@ export class StatifiedMap<K, V> extends Map<K, V> implements Statify<Map<K, V>>
58
58
  return this;
59
59
  }
60
60
  }
61
+
62
+ (StatifiedMap.prototype as any)[isStatifiedMapKey] = true;
package/src/quirks/set.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { exitProxySymbol, getGlobalStateMode, setMetadataOf, statifySealKey, type Statify } from "../internals.js";
1
+ import { exitProxySymbol, getGlobalStateMode, isStatifiedSetKey, setMetadataOf, statifySealKey, type Statify } from "../internals.js";
2
2
  import { StateMetadata, StatifiableObj, type ExitProxyValue, type StatifiableProp } from "../low.js";
3
3
 
4
4
  export class StatifiedSet<T extends StatifiableProp> extends Set<T> implements Statify<Set<T>> {
@@ -51,3 +51,5 @@ export class StatifiedSet<T extends StatifiableProp> extends Set<T> implements S
51
51
  return false;
52
52
  }
53
53
  }
54
+
55
+ (StatifiedSet.prototype as any)[isStatifiedSetKey] = true;
package/src/test.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import $ from "./high.js";
2
- import { BaseStatified } from "./quirks/basestatified.js";
3
2
  import { StatifiedSet } from "./quirks/set.js";
4
3
 
5
4
  const stateful = $.state<{ a: ({ d: number })[], b?: { c?: { d?: Set<number> } } }>({ a: [] });
@@ -27,20 +26,19 @@ const asdf2 = $.state({ c: asdf });
27
26
  // const aassddff = $.state(new Set());
28
27
  stateful.b = asdf2;
29
28
 
30
- class Wayland extends BaseStatified {
31
- displays = new StatifiedSet();
32
-
33
- #state = 0;
34
- get state() { return this.#state; }
35
- set state(v: number) {
36
- console.log("set", v)
37
- this.#state = v;
38
- }
39
-
40
- constructor() {
41
- super();
42
- }
43
- }
29
+ const Wayland = $.statifyClass(
30
+ (Base) => class Wayland extends Base {
31
+ displays = new StatifiedSet();
32
+
33
+ #state = 0;
34
+ get state() { return this.#state; }
35
+ set state(v: number) {
36
+ console.log("set", v);
37
+ this.#state = v;
38
+ }
39
+ },
40
+ Object,
41
+ );
44
42
 
45
43
  const w = new Wayland();
46
44
  $.onSet(() => w.state, (v) => console.log("asdf awawa!!", v));