@oscarpalmer/mora 0.18.2 → 0.20.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.
@@ -1,11 +1,14 @@
1
+ import type {GenericCallback} from '@oscarpalmer/atoms';
1
2
  import {arrayName} from '../helpers/is';
2
- import {setValueInProxy} from '../helpers/proxy';
3
+ import {getReactiveValueInProxy, setValueInProxy} from '../helpers/proxy';
3
4
  import {emitValue, equalArrays, getValue} from '../helpers/value';
5
+ import {type Unsubscribe, noop, subscribe} from '../subscription';
4
6
  import {type Computed, computed} from './computed';
5
7
  import {Reactive, type ReactiveOptions, type ReactiveState} from './reactive';
6
8
  import {type Signal, signal} from './signal';
7
9
 
8
10
  export class ReactiveArray<Item> extends Reactive<Item[], Item> {
11
+ #indiced = new Map<number, Computed<unknown>>();
9
12
  #size = signal(0);
10
13
 
11
14
  /**
@@ -52,13 +55,6 @@ export class ReactiveArray<Item> extends Reactive<Item[], Item> {
52
55
  this.#size.set(value.length);
53
56
  }
54
57
 
55
- /**
56
- * Get an indexed item
57
- */
58
- at(index: number): Item | undefined {
59
- return this.get().at(index);
60
- }
61
-
62
58
  /**
63
59
  * Clear the array
64
60
  */
@@ -69,7 +65,27 @@ export class ReactiveArray<Item> extends Reactive<Item[], Item> {
69
65
  /**
70
66
  * @inheritdoc
71
67
  */
72
- get(): Item[] {
68
+ get(): Item[];
69
+
70
+ /**
71
+ * Get the value at an index
72
+ */
73
+ get(index: number): Item | undefined;
74
+
75
+ /**
76
+ * Get the length of the array
77
+ */
78
+ get(property: 'length'): number;
79
+
80
+ get(first?: unknown): unknown {
81
+ if (typeof first === 'number') {
82
+ return getReactiveValueInProxy(this, this.#indiced, first, true).get();
83
+ }
84
+
85
+ if (first === 'length') {
86
+ return this.length;
87
+ }
88
+
73
89
  return getValue(this.state);
74
90
  }
75
91
 
@@ -122,7 +138,7 @@ export class ReactiveArray<Item> extends Reactive<Item[], Item> {
122
138
  /**
123
139
  * Set the value
124
140
  */
125
- set(value: Item[]): void;
141
+ set(value?: Item[]): void;
126
142
 
127
143
  /**
128
144
  * Set the value at an index
@@ -134,9 +150,9 @@ export class ReactiveArray<Item> extends Reactive<Item[], Item> {
134
150
  */
135
151
  set(property: 'length', value: number): void;
136
152
 
137
- set(first: number | 'length' | Item[], second?: number | Item): void {
138
- if (Array.isArray(first)) {
139
- this.state.value.splice(0, this.state.value.length, ...first);
153
+ set(first?: number | 'length' | Item[], second?: number | Item): void {
154
+ if (first == null || Array.isArray(first)) {
155
+ this.state.value.splice(0, this.state.value.length, ...(first ?? []));
140
156
  } else if (first === 'length') {
141
157
  this.length = second as number;
142
158
  } else if (typeof first === 'number') {
@@ -162,12 +178,52 @@ export class ReactiveArray<Item> extends Reactive<Item[], Item> {
162
178
  );
163
179
  }
164
180
 
181
+ /**
182
+ * @inheritdoc
183
+ */
184
+ subscribe(callback: (value: Item[]) => void): Unsubscribe;
185
+
186
+ /**
187
+ * Subscribe to changes at a specific index
188
+ */
189
+ subscribe(
190
+ index: number,
191
+ callback: (value: Item | undefined) => void,
192
+ ): Unsubscribe;
193
+
194
+ subscribe(
195
+ first: number | GenericCallback,
196
+ second?: GenericCallback,
197
+ ): Unsubscribe {
198
+ if (typeof first === 'number' && typeof second === 'function') {
199
+ return getReactiveValueInProxy(
200
+ this,
201
+ this.#indiced,
202
+ first,
203
+ true,
204
+ ).subscribe(second);
205
+ }
206
+
207
+ return typeof first === 'function' ? subscribe(this.state, first) : noop;
208
+ }
209
+
165
210
  /**
166
211
  * Add items to the beginning of the array
167
212
  */
168
213
  unshift(...items: Item[]): number {
169
214
  return this.state.value.unshift(...items);
170
215
  }
216
+
217
+ /**
218
+ * Update the value _(based on the current value)_
219
+ */
220
+ update(callback: (value: Item[]) => Item[]): void {
221
+ const updated = callback(this.state.value);
222
+
223
+ if (updated == null || Array.isArray(updated)) {
224
+ this.set(updated);
225
+ }
226
+ }
171
227
  }
172
228
 
173
229
  /**
@@ -1,3 +1,4 @@
1
+ import type {GenericCallback} from '@oscarpalmer/atoms/models';
1
2
  import type {Effect} from '../effect';
2
3
  import {
3
4
  type Subscription,
@@ -80,6 +81,6 @@ export type ReactiveState<Value, Equal> = {
80
81
  computeds: Set<Computed<unknown>>;
81
82
  effects: Set<Effect>;
82
83
  equal: (first: Equal, second: Equal) => boolean;
83
- subscriptions: Map<(value: Value) => void, Subscription<Value>>;
84
+ subscriptions: Map<GenericCallback, Subscription>;
84
85
  value: Value;
85
86
  };
@@ -26,7 +26,7 @@ export class Signal<Value> extends Reactive<Value> {
26
26
  }
27
27
 
28
28
  /**
29
- * Update the value
29
+ * Update the value _(based on the current value)_
30
30
  */
31
31
  update(callback: (value: Value) => Value): void {
32
32
  this.set(callback(this.state.value));
@@ -1,11 +1,23 @@
1
1
  import {isKey, isPlainObject} from '@oscarpalmer/atoms/is';
2
- import type {Key, PlainObject} from '@oscarpalmer/atoms/models';
2
+ import type {
3
+ GenericCallback,
4
+ Key,
5
+ PlainObject,
6
+ } from '@oscarpalmer/atoms/models';
3
7
  import {storeName} from '../helpers/is';
4
- import {setProxyValue, setValueInProxy} from '../helpers/proxy';
8
+ import {
9
+ getReactiveValueInProxy,
10
+ setProxyValue,
11
+ setValueInProxy,
12
+ } from '../helpers/proxy';
5
13
  import {getValue} from '../helpers/value';
14
+ import {type Unsubscribe, noop, subscribe} from '../subscription';
15
+ import type {Computed} from './computed';
6
16
  import {Reactive, type ReactiveOptions} from './reactive';
7
17
 
8
18
  export class Store<Value extends PlainObject> extends Reactive<Value, Value> {
19
+ #keyed = new Map<Key, Computed<unknown>>();
20
+
9
21
  constructor(value: Value, options?: ReactiveOptions<Value>) {
10
22
  super(
11
23
  storeName,
@@ -33,7 +45,9 @@ export class Store<Value extends PlainObject> extends Reactive<Value, Value> {
33
45
  get(key: Key): unknown;
34
46
 
35
47
  get(key?: unknown): unknown {
36
- return isKey(key) ? this.state.value[key] : getValue(this.state);
48
+ return isKey(key)
49
+ ? getReactiveValueInProxy(this, this.#keyed, key, false).get()
50
+ : getValue(this.state);
37
51
  }
38
52
 
39
53
  /**
@@ -77,6 +91,48 @@ export class Store<Value extends PlainObject> extends Reactive<Value, Value> {
77
91
  setProxyValue(this.state.value, first ?? {});
78
92
  }
79
93
  }
94
+
95
+ /**
96
+ * @inheritdoc
97
+ */
98
+ subscribe(callback: (value: Value) => void): Unsubscribe;
99
+
100
+ /**
101
+ * Subscribe to changes for a specific key
102
+ */
103
+ subscribe<Key extends keyof Value>(
104
+ key: Key,
105
+ callback: (value: Value[Key] | undefined) => void,
106
+ ): Unsubscribe;
107
+
108
+ /**
109
+ * Subscribe to changes for a specific key
110
+ */
111
+ subscribe(key: Key, callback: (value: unknown) => void): Unsubscribe;
112
+
113
+ subscribe(
114
+ first: Key | GenericCallback,
115
+ second?: GenericCallback,
116
+ ): Unsubscribe {
117
+ if (isKey(first) && typeof second === 'function') {
118
+ return getReactiveValueInProxy(this, this.#keyed, first, false).subscribe(
119
+ second,
120
+ );
121
+ }
122
+
123
+ return typeof first === 'function' ? subscribe(this.state, first) : noop;
124
+ }
125
+
126
+ /**
127
+ * Update the value _(based on the current value)_
128
+ */
129
+ update(callback: (value: Value) => Value): void {
130
+ const updated = callback({...this.state.value});
131
+
132
+ if (updated == null || isPlainObject(updated)) {
133
+ setProxyValue(this.state.value, updated ?? {});
134
+ }
135
+ }
80
136
  }
81
137
 
82
138
  /**
package/types/batch.d.cts CHANGED
@@ -52,13 +52,13 @@ export type ReactiveState<Value, Equal> = {
52
52
  computeds: Set<Computed<unknown>>;
53
53
  effects: Set<Effect>;
54
54
  equal: (first: Equal, second: Equal) => boolean;
55
- subscriptions: Map<(value: Value) => void, Subscription<Value>>;
55
+ subscriptions: Map<GenericCallback, Subscription>;
56
56
  value: Value;
57
57
  };
58
- declare class Subscription<Value> {
59
- state: ReactiveState<Value, never>;
58
+ declare class Subscription {
59
+ state: ReactiveState<unknown, never>;
60
60
  callback: GenericCallback;
61
- constructor(state: ReactiveState<Value, never>, callback: GenericCallback);
61
+ constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
62
62
  }
63
63
  /**
64
64
  * Unsubscribe from changes
@@ -73,7 +73,7 @@ export declare function startBatch(): void;
73
73
  * Stop batching effects and flush _(run)_ them
74
74
  */
75
75
  export declare function stopBatch(): void;
76
- export declare const batchedHandlers: Set<Effect | Subscription<unknown>>;
76
+ export declare const batchedHandlers: Set<Effect | Subscription>;
77
77
  export declare let batchDepth: number;
78
78
 
79
79
  export {};
package/types/batch.d.ts CHANGED
@@ -9,5 +9,5 @@ export declare function startBatch(): void;
9
9
  * Stop batching effects and flush _(run)_ them
10
10
  */
11
11
  export declare function stopBatch(): void;
12
- export declare const batchedHandlers: Set<Effect | Subscription<unknown>>;
12
+ export declare const batchedHandlers: Set<Subscription | Effect>;
13
13
  export declare let batchDepth: number;
@@ -60,13 +60,13 @@ export type ReactiveState<Value, Equal> = {
60
60
  computeds: Set<Computed<unknown>>;
61
61
  effects: Set<Effect>;
62
62
  equal: (first: Equal, second: Equal) => boolean;
63
- subscriptions: Map<(value: Value) => void, Subscription<Value>>;
63
+ subscriptions: Map<GenericCallback, Subscription>;
64
64
  value: Value;
65
65
  };
66
- declare class Subscription<Value> {
67
- state: ReactiveState<Value, never>;
66
+ declare class Subscription {
67
+ state: ReactiveState<unknown, never>;
68
68
  callback: GenericCallback;
69
- constructor(state: ReactiveState<Value, never>, callback: GenericCallback);
69
+ constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
70
70
  }
71
71
  /**
72
72
  * Unsubscribe from changes
@@ -83,10 +83,6 @@ declare class ReactiveArray<Item> extends Reactive<Item[], Item> {
83
83
  */
84
84
  set length(value: number);
85
85
  constructor(value: Item[], options?: ReactiveOptions<Item>);
86
- /**
87
- * Get an indexed item
88
- */
89
- at(index: number): Item | undefined;
90
86
  /**
91
87
  * Clear the array
92
88
  */
@@ -95,6 +91,14 @@ declare class ReactiveArray<Item> extends Reactive<Item[], Item> {
95
91
  * @inheritdoc
96
92
  */
97
93
  get(): Item[];
94
+ /**
95
+ * Get the value at an index
96
+ */
97
+ get(index: number): Item | undefined;
98
+ /**
99
+ * Get the length of the array
100
+ */
101
+ get(property: "length"): number;
98
102
  /**
99
103
  * Create a computed, filtered array
100
104
  */
@@ -122,7 +126,7 @@ declare class ReactiveArray<Item> extends Reactive<Item[], Item> {
122
126
  /**
123
127
  * Set the value
124
128
  */
125
- set(value: Item[]): void;
129
+ set(value?: Item[]): void;
126
130
  /**
127
131
  * Set the value at an index
128
132
  */
@@ -139,10 +143,22 @@ declare class ReactiveArray<Item> extends Reactive<Item[], Item> {
139
143
  * Remove and return items from the array _(and optionally add new items)_
140
144
  */
141
145
  splice(from: number, to?: number, ...items: Item[]): Item[];
146
+ /**
147
+ * @inheritdoc
148
+ */
149
+ subscribe(callback: (value: Item[]) => void): Unsubscribe;
150
+ /**
151
+ * Subscribe to changes at a specific index
152
+ */
153
+ subscribe(index: number, callback: (value: Item | undefined) => void): Unsubscribe;
142
154
  /**
143
155
  * Add items to the beginning of the array
144
156
  */
145
157
  unshift(...items: Item[]): number;
158
+ /**
159
+ * Update the value _(based on the current value)_
160
+ */
161
+ update(callback: (value: Item[]) => Item[]): void;
146
162
  }
147
163
  declare class Signal<Value> extends Reactive<Value> {
148
164
  constructor(value: Value, options?: ReactiveOptions<Value>);
@@ -155,11 +171,12 @@ declare class Signal<Value> extends Reactive<Value> {
155
171
  */
156
172
  set(value: Value): void;
157
173
  /**
158
- * Update the value
174
+ * Update the value _(based on the current value)_
159
175
  */
160
176
  update(callback: (value: Value) => Value): void;
161
177
  }
162
178
  declare class Store<Value extends PlainObject> extends Reactive<Value, Value> {
179
+ #private;
163
180
  constructor(value: Value, options?: ReactiveOptions<Value>);
164
181
  /**
165
182
  * @inheritdoc
@@ -197,6 +214,22 @@ declare class Store<Value extends PlainObject> extends Reactive<Value, Value> {
197
214
  * Set a value by key
198
215
  */
199
216
  set(key: Key, value: unknown): void;
217
+ /**
218
+ * @inheritdoc
219
+ */
220
+ subscribe(callback: (value: Value) => void): Unsubscribe;
221
+ /**
222
+ * Subscribe to changes for a specific key
223
+ */
224
+ subscribe<Key extends keyof Value>(key: Key, callback: (value: Value[Key] | undefined) => void): Unsubscribe;
225
+ /**
226
+ * Subscribe to changes for a specific key
227
+ */
228
+ subscribe(key: Key, callback: (value: unknown) => void): Unsubscribe;
229
+ /**
230
+ * Update the value _(based on the current value)_
231
+ */
232
+ update(callback: (value: Value) => Value): void;
200
233
  }
201
234
  /**
202
235
  * Is the value a reactive array?
@@ -5,6 +5,14 @@
5
5
  */
6
6
  export type ArrayOrPlainObject = unknown[] | Record<PropertyKey, unknown>;
7
7
  export type GenericCallback = (...args: any[]) => any;
8
+ /**
9
+ * A useful key type
10
+ */
11
+ export type Key = number | string;
12
+ /**
13
+ * A generic object
14
+ */
15
+ export type PlainObject = Record<PropertyKey, unknown>;
8
16
  declare class Effect {
9
17
  private readonly $mora;
10
18
  private readonly state;
@@ -56,18 +64,106 @@ export type ReactiveState<Value, Equal> = {
56
64
  computeds: Set<Computed<unknown>>;
57
65
  effects: Set<Effect>;
58
66
  equal: (first: Equal, second: Equal) => boolean;
59
- subscriptions: Map<(value: Value) => void, Subscription<Value>>;
67
+ subscriptions: Map<GenericCallback, Subscription>;
60
68
  value: Value;
61
69
  };
62
- declare class Subscription<Value> {
63
- state: ReactiveState<Value, never>;
70
+ declare class Subscription {
71
+ state: ReactiveState<unknown, never>;
64
72
  callback: GenericCallback;
65
- constructor(state: ReactiveState<Value, never>, callback: GenericCallback);
73
+ constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
66
74
  }
67
75
  /**
68
76
  * Unsubscribe from changes
69
77
  */
70
78
  export type Unsubscribe = () => void;
79
+ declare class ReactiveArray<Item> extends Reactive<Item[], Item> {
80
+ #private;
81
+ /**
82
+ * The length of the array
83
+ */
84
+ get length(): number;
85
+ /**
86
+ * Set the length of the array
87
+ */
88
+ set length(value: number);
89
+ constructor(value: Item[], options?: ReactiveOptions<Item>);
90
+ /**
91
+ * Clear the array
92
+ */
93
+ clear(): void;
94
+ /**
95
+ * @inheritdoc
96
+ */
97
+ get(): Item[];
98
+ /**
99
+ * Get the value at an index
100
+ */
101
+ get(index: number): Item | undefined;
102
+ /**
103
+ * Get the length of the array
104
+ */
105
+ get(property: "length"): number;
106
+ /**
107
+ * Create a computed, filtered array
108
+ */
109
+ filter(callback: (item: Item, index: number, array: Item[]) => boolean): Computed<Item[]>;
110
+ /**
111
+ * Create a computed, mapped array
112
+ */
113
+ map<Mapped>(callback: (item: Item, index: number, array: Item[]) => Mapped): Computed<Mapped[]>;
114
+ /**
115
+ * @inheritdoc
116
+ */
117
+ peek(): Item[];
118
+ /**
119
+ * Get the length of the array _(without reactivity)_
120
+ */
121
+ peek(length: true): number;
122
+ /**
123
+ * Remove and return the last item of the array
124
+ */
125
+ pop(): Item | undefined;
126
+ /**
127
+ * Add items to the end of the array
128
+ */
129
+ push(...items: Item[]): number;
130
+ /**
131
+ * Set the value
132
+ */
133
+ set(value?: Item[]): void;
134
+ /**
135
+ * Set the value at an index
136
+ */
137
+ set(index: number, value: Item): void;
138
+ /**
139
+ * Set the length of the array
140
+ */
141
+ set(property: "length", value: number): void;
142
+ /**
143
+ * Remove and return the first item of the array
144
+ */
145
+ shift(): Item | undefined;
146
+ /**
147
+ * Remove and return items from the array _(and optionally add new items)_
148
+ */
149
+ splice(from: number, to?: number, ...items: Item[]): Item[];
150
+ /**
151
+ * @inheritdoc
152
+ */
153
+ subscribe(callback: (value: Item[]) => void): Unsubscribe;
154
+ /**
155
+ * Subscribe to changes at a specific index
156
+ */
157
+ subscribe(index: number, callback: (value: Item | undefined) => void): Unsubscribe;
158
+ /**
159
+ * Add items to the beginning of the array
160
+ */
161
+ unshift(...items: Item[]): number;
162
+ /**
163
+ * Update the value _(based on the current value)_
164
+ */
165
+ update(callback: (value: Item[]) => Item[]): void;
166
+ }
71
167
  declare class Signal<Value> extends Reactive<Value> {
72
168
  constructor(value: Value, options?: ReactiveOptions<Value>);
73
169
  /**
@@ -79,10 +175,68 @@ declare class Signal<Value> extends Reactive<Value> {
79
175
  */
80
176
  set(value: Value): void;
81
177
  /**
82
- * Update the value
178
+ * Update the value _(based on the current value)_
179
+ */
180
+ update(callback: (value: Value) => Value): void;
181
+ }
182
+ declare class Store<Value extends PlainObject> extends Reactive<Value, Value> {
183
+ #private;
184
+ constructor(value: Value, options?: ReactiveOptions<Value>);
185
+ /**
186
+ * @inheritdoc
187
+ */
188
+ get(): Value;
189
+ /**
190
+ * Get a value by key _(without reactivity)_
191
+ */
192
+ get(key: keyof Value): Value[keyof Value];
193
+ /**
194
+ * Get a value by key _(without reactivity)_
195
+ */
196
+ get(key: Key): unknown;
197
+ /**
198
+ * Get the value _(without reactivity)_
199
+ */
200
+ peek(): Value;
201
+ /**
202
+ * Get a value by key _(without reactivity)_
203
+ */
204
+ peek(key: keyof Value): Value[keyof Value];
205
+ /**
206
+ * Get a value by key _(without reactivity)_
207
+ */
208
+ peek(key: Key): unknown;
209
+ /**
210
+ * Set the value
211
+ */
212
+ set(value?: Value): void;
213
+ /**
214
+ * Set a value by key
215
+ */
216
+ set(key: keyof Value, value: Value[keyof Value]): void;
217
+ /**
218
+ * Set a value by key
219
+ */
220
+ set(key: Key, value: unknown): void;
221
+ /**
222
+ * @inheritdoc
223
+ */
224
+ subscribe(callback: (value: Value) => void): Unsubscribe;
225
+ /**
226
+ * Subscribe to changes for a specific key
227
+ */
228
+ subscribe<Key extends keyof Value>(key: Key, callback: (value: Value[Key] | undefined) => void): Unsubscribe;
229
+ /**
230
+ * Subscribe to changes for a specific key
231
+ */
232
+ subscribe(key: Key, callback: (value: unknown) => void): Unsubscribe;
233
+ /**
234
+ * Update the value _(based on the current value)_
83
235
  */
84
236
  update(callback: (value: Value) => Value): void;
85
237
  }
238
+ export declare function getReactiveValueInProxy<Value>(array: ReactiveArray<Value>, mapped: Map<Key, Computed<unknown>>, index: number, isArray: true): Computed<unknown>;
239
+ export declare function getReactiveValueInProxy<Value extends PlainObject>(store: Store<Value>, mapped: Map<Key, Computed<unknown>>, key: Key, isArray: false): Computed<unknown>;
86
240
  export declare function setProxyValue(proxy: ArrayOrPlainObject, value: ArrayOrPlainObject): void;
87
241
  export declare function setValueInProxy<Value extends ArrayOrPlainObject, Equal>(target: Value, property: PropertyKey, value: unknown, state: ReactiveState<Value, Equal>, isArray: boolean, length?: Signal<number>): boolean;
88
242
 
@@ -1,5 +1,10 @@
1
- import type { ArrayOrPlainObject } from '@oscarpalmer/atoms/models';
1
+ import type { ArrayOrPlainObject, Key, PlainObject } from '@oscarpalmer/atoms/models';
2
+ import type { ReactiveArray } from '../value/array';
3
+ import { type Computed } from '../value/computed';
2
4
  import type { ReactiveState } from '../value/reactive';
3
5
  import type { Signal } from '../value/signal';
6
+ import type { Store } from '../value/store';
7
+ export declare function getReactiveValueInProxy<Value>(array: ReactiveArray<Value>, mapped: Map<Key, Computed<unknown>>, index: number, isArray: true): Computed<unknown>;
8
+ export declare function getReactiveValueInProxy<Value extends PlainObject>(store: Store<Value>, mapped: Map<Key, Computed<unknown>>, key: Key, isArray: false): Computed<unknown>;
4
9
  export declare function setProxyValue(proxy: ArrayOrPlainObject, value: ArrayOrPlainObject): void;
5
10
  export declare function setValueInProxy<Value extends ArrayOrPlainObject, Equal>(target: Value, property: PropertyKey, value: unknown, state: ReactiveState<Value, Equal>, isArray: boolean, length?: Signal<number>): boolean;
@@ -52,13 +52,13 @@ export type ReactiveState<Value, Equal> = {
52
52
  computeds: Set<Computed<unknown>>;
53
53
  effects: Set<Effect>;
54
54
  equal: (first: Equal, second: Equal) => boolean;
55
- subscriptions: Map<(value: Value) => void, Subscription<Value>>;
55
+ subscriptions: Map<GenericCallback, Subscription>;
56
56
  value: Value;
57
57
  };
58
- declare class Subscription<Value> {
59
- state: ReactiveState<Value, never>;
58
+ declare class Subscription {
59
+ state: ReactiveState<unknown, never>;
60
60
  callback: GenericCallback;
61
- constructor(state: ReactiveState<Value, never>, callback: GenericCallback);
61
+ constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
62
62
  }
63
63
  /**
64
64
  * Unsubscribe from changes