event-emission 0.2.0 → 0.2.1
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.
- package/README.md +80 -24
- package/dist/event-emission.d.ts +13 -14
- package/dist/event-emission.d.ts.map +1 -1
- package/dist/factory.d.ts +1 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.cjs +474 -285
- package/dist/index.cjs.map +8 -9
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +449 -278
- package/dist/index.js.map +8 -9
- package/dist/interoperability.cjs +1605 -0
- package/dist/interoperability.cjs.map +15 -0
- package/dist/{interop.d.ts → interoperability.d.ts} +2 -1
- package/dist/interoperability.d.ts.map +1 -0
- package/dist/interoperability.js +1555 -0
- package/dist/interoperability.js.map +15 -0
- package/dist/observable.cjs +286 -0
- package/dist/observable.cjs.map +11 -0
- package/dist/observable.js +253 -0
- package/dist/observable.js.map +11 -0
- package/dist/observe.cjs +344 -0
- package/dist/observe.cjs.map +10 -0
- package/dist/observe.d.ts +6 -1
- package/dist/observe.d.ts.map +1 -1
- package/dist/observe.js +313 -0
- package/dist/observe.js.map +10 -0
- package/dist/symbols.d.ts +1 -1
- package/dist/types.cjs +35 -0
- package/dist/types.cjs.map +9 -0
- package/dist/types.d.ts +60 -25
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -0
- package/dist/types.js.map +9 -0
- package/package.json +25 -1
- package/src/event-emission.ts +26 -20
- package/src/factory.ts +538 -218
- package/src/index.ts +4 -33
- package/src/{interop.ts → interoperability.ts} +24 -6
- package/src/observe.ts +54 -17
- package/src/symbols.ts +1 -1
- package/src/types.ts +75 -30
- package/dist/interop.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -59,17 +59,38 @@ events.dispatchEvent({
|
|
|
59
59
|
## Core concepts
|
|
60
60
|
|
|
61
61
|
- **Event map**: a TypeScript type that maps event names to payload types.
|
|
62
|
-
- **Event shape**: `{ type: string; detail: Payload }` for
|
|
62
|
+
- **Event shape**: `{ type: string; detail: Payload; bubbles?: boolean; cancelable?: boolean; composed?: boolean }` for dispatch.
|
|
63
63
|
- **Unsubscribe**: `addEventListener` returns a function to remove the listener.
|
|
64
64
|
|
|
65
65
|
## API overview
|
|
66
66
|
|
|
67
|
+
Core (`event-emission`):
|
|
68
|
+
|
|
67
69
|
- `createEventTarget<E>(options?)`
|
|
68
70
|
- `createEventTarget(target, { observe: true, ... })`
|
|
69
71
|
- `EventEmission<E>` base class
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
|
|
73
|
+
Optional subpaths:
|
|
74
|
+
|
|
75
|
+
- `Observable<T>` compliant implementation (`event-emission/observable`)
|
|
76
|
+
- Interoperability: `fromEventTarget`, `forwardToEventTarget`, `pipe` (`event-emission/interoperability`)
|
|
77
|
+
- Observe utilities: `isObserved`, `getOriginal`, `setupEventForwarding` (`event-emission/observe`)
|
|
78
|
+
- Types-only exports (`event-emission/types`)
|
|
79
|
+
|
|
80
|
+
## Subpath exports
|
|
81
|
+
|
|
82
|
+
To keep the core entrypoint lean, optional features are exposed via subpath exports:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { Observable } from 'event-emission/observable';
|
|
86
|
+
import { getOriginal, isObserved, setupEventForwarding } from 'event-emission/observe';
|
|
87
|
+
import {
|
|
88
|
+
forwardToEventTarget,
|
|
89
|
+
fromEventTarget,
|
|
90
|
+
pipe,
|
|
91
|
+
} from 'event-emission/interoperability';
|
|
92
|
+
import type { EventTargetLike } from 'event-emission/types';
|
|
93
|
+
```
|
|
73
94
|
|
|
74
95
|
## createEventTarget
|
|
75
96
|
|
|
@@ -117,11 +138,29 @@ state.user.name = 'Grace'; // Triggers 'update' and 'update:user.name'
|
|
|
117
138
|
|
|
118
139
|
**Observe options:**
|
|
119
140
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
| `
|
|
141
|
+
Deep observation is enabled by default.
|
|
142
|
+
|
|
143
|
+
| Option | Type | Default | Description |
|
|
144
|
+
| --------------- | ------------------------------- | -------- | ------------------------------------------------------------------ |
|
|
145
|
+
| `observe` | `boolean` | `false` | Enable property change observation |
|
|
146
|
+
| `deep` | `boolean` | `true` | Observe nested objects |
|
|
147
|
+
| `cloneStrategy` | `'shallow' \| 'deep' \| 'path'` | `'path'` | How to clone previous state |
|
|
148
|
+
| `deepClone` | `<T>(value: T) => T` | - | Optional deep clone fallback when `structuredClone` is unavailable |
|
|
149
|
+
|
|
150
|
+
Note: `cloneStrategy: 'deep'` uses `structuredClone` by default, or `deepClone` if provided.
|
|
151
|
+
|
|
152
|
+
Example fallback:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
const state = createEventTarget(
|
|
156
|
+
{ count: 0, user: { name: 'Ada' } },
|
|
157
|
+
{
|
|
158
|
+
observe: true,
|
|
159
|
+
cloneStrategy: 'deep',
|
|
160
|
+
deepClone: (value) => JSON.parse(JSON.stringify(value)),
|
|
161
|
+
},
|
|
162
|
+
);
|
|
163
|
+
```
|
|
125
164
|
|
|
126
165
|
**Update event details:**
|
|
127
166
|
|
|
@@ -146,6 +185,7 @@ clicks.subscribe((event) => {
|
|
|
146
185
|
|
|
147
186
|
| Option | Type | Default | Description |
|
|
148
187
|
| -------------- | ------------- | ------- | -------------------------------------------------------------------------------------- |
|
|
188
|
+
| `capture` | `boolean` | `false` | If true, listen during the capture phase |
|
|
149
189
|
| `receiveError` | `boolean` | `false` | If true, listen for "error" events and forward them to the observer's error method |
|
|
150
190
|
| `handler` | `Function` | `null` | Optional function to run stateful actions (like `preventDefault()`) before dispatching |
|
|
151
191
|
| `once` | `boolean` | `false` | If true, the observable completes after the first event is dispatched |
|
|
@@ -164,18 +204,22 @@ const unsubscribe = events.addEventListener('message', (event) => {
|
|
|
164
204
|
unsubscribe();
|
|
165
205
|
```
|
|
166
206
|
|
|
167
|
-
**Options:**
|
|
207
|
+
**Options:** (or pass `true`/`false` for capture)
|
|
168
208
|
|
|
169
|
-
| Option
|
|
170
|
-
|
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
209
|
+
| Option | Type | Description |
|
|
210
|
+
| --------- | ------------- | -------------------------------------------- |
|
|
211
|
+
| `capture` | `boolean` | Listen during the capture phase |
|
|
212
|
+
| `once` | `boolean` | Remove listener after first invocation |
|
|
213
|
+
| `passive` | `boolean` | Listener will not call `preventDefault()` |
|
|
214
|
+
| `signal` | `AbortSignal` | Abort signal to remove listener when aborted |
|
|
215
|
+
|
|
216
|
+
Note: `preventDefault()` only affects events dispatched with `cancelable: true`. `dispatchEvent` returns `false` when a cancelable event is prevented.
|
|
173
217
|
|
|
174
218
|
### `once(type, listener, options?)`
|
|
175
219
|
|
|
176
220
|
Adds a one-time listener.
|
|
177
221
|
|
|
178
|
-
### `removeEventListener(type, listener)`
|
|
222
|
+
### `removeEventListener(type, listener, options?)`
|
|
179
223
|
|
|
180
224
|
Removes a specific listener.
|
|
181
225
|
|
|
@@ -266,7 +310,7 @@ observable
|
|
|
266
310
|
A fully compliant implementation of the TC39 Observable proposal.
|
|
267
311
|
|
|
268
312
|
```typescript
|
|
269
|
-
import { Observable } from 'event-emission';
|
|
313
|
+
import { Observable } from 'event-emission/observable';
|
|
270
314
|
|
|
271
315
|
// Create from items
|
|
272
316
|
const numbers = Observable.of(1, 2, 3);
|
|
@@ -316,7 +360,7 @@ class UserService extends EventEmission<{
|
|
|
316
360
|
### `fromEventTarget(domTarget, eventTypes, options?)`
|
|
317
361
|
|
|
318
362
|
```typescript
|
|
319
|
-
import { fromEventTarget } from 'event-emission';
|
|
363
|
+
import { fromEventTarget } from 'event-emission/interoperability';
|
|
320
364
|
|
|
321
365
|
type ButtonEvents = {
|
|
322
366
|
click: MouseEvent;
|
|
@@ -336,7 +380,8 @@ events.destroy();
|
|
|
336
380
|
### `forwardToEventTarget(source, domTarget, options?)`
|
|
337
381
|
|
|
338
382
|
```typescript
|
|
339
|
-
import { createEventTarget
|
|
383
|
+
import { createEventTarget } from 'event-emission';
|
|
384
|
+
import { forwardToEventTarget } from 'event-emission/interoperability';
|
|
340
385
|
|
|
341
386
|
const events = createEventTarget<{ custom: { value: number } }>();
|
|
342
387
|
const element = document.getElementById('target');
|
|
@@ -351,7 +396,8 @@ unsubscribe();
|
|
|
351
396
|
### `pipe(source, target, options?)`
|
|
352
397
|
|
|
353
398
|
```typescript
|
|
354
|
-
import { createEventTarget
|
|
399
|
+
import { createEventTarget } from 'event-emission';
|
|
400
|
+
import { pipe } from 'event-emission/interoperability';
|
|
355
401
|
|
|
356
402
|
const componentEvents = createEventTarget<{ ready: void }>();
|
|
357
403
|
const appBus = createEventTarget<{ ready: void }>();
|
|
@@ -361,7 +407,7 @@ const unsubscribe = pipe(componentEvents, appBus);
|
|
|
361
407
|
unsubscribe();
|
|
362
408
|
```
|
|
363
409
|
|
|
364
|
-
Note: `pipe(source, target)`
|
|
410
|
+
Note: Both `pipe(source, target)` and `events.pipe(target)` forward all events via a wildcard listener. Use a map function to transform events or return `null` to filter.
|
|
365
411
|
|
|
366
412
|
## React integration
|
|
367
413
|
|
|
@@ -451,26 +497,36 @@ const state = useObservable(store);
|
|
|
451
497
|
|
|
452
498
|
Checks if an object is an observed proxy.
|
|
453
499
|
|
|
500
|
+
```typescript
|
|
501
|
+
import { isObserved } from 'event-emission/observe';
|
|
502
|
+
```
|
|
503
|
+
|
|
454
504
|
### `getOriginal(proxy)`
|
|
455
505
|
|
|
456
506
|
Returns the original unproxied object.
|
|
457
507
|
|
|
508
|
+
```typescript
|
|
509
|
+
import { getOriginal } from 'event-emission/observe';
|
|
510
|
+
```
|
|
511
|
+
|
|
458
512
|
## TypeScript types
|
|
459
513
|
|
|
460
514
|
```typescript
|
|
461
515
|
import type {
|
|
462
516
|
EmissionEvent,
|
|
463
517
|
EventTargetLike,
|
|
464
|
-
Observable,
|
|
465
518
|
ObservableLike,
|
|
466
519
|
Observer,
|
|
467
520
|
Subscription,
|
|
468
521
|
WildcardEvent,
|
|
469
522
|
AddEventListenerOptionsLike,
|
|
523
|
+
} from 'event-emission/types';
|
|
524
|
+
|
|
525
|
+
import type {
|
|
470
526
|
ObservableEventMap,
|
|
471
527
|
PropertyChangeDetail,
|
|
472
528
|
ArrayMutationDetail,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
} from 'event-emission';
|
|
529
|
+
} from 'event-emission/observe';
|
|
530
|
+
|
|
531
|
+
import type { Subscriber, SubscriptionObserver } from 'event-emission/observable';
|
|
476
532
|
```
|
package/dist/event-emission.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SymbolObservable } from './symbols';
|
|
2
|
-
import type { AddEventListenerOptionsLike, EmissionEvent, EventsIteratorOptions, EventTargetLike, ObservableLike, Observer, OnOptions, Subscription, WildcardEvent } from './types';
|
|
2
|
+
import type { AddEventListenerOptionsLike, DispatchEventInput, DOMEventLike, EmissionEvent, EventListenerLike, EventListenerOptionsLike, EventsIteratorOptions, EventTargetLike, ObservableLike, Observer, OnOptions, Subscription, WildcardEvent } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class for typed event emitters with DOM EventTarget
|
|
5
5
|
* and TC39 Observable compatibility.
|
|
@@ -7,7 +7,7 @@ import type { AddEventListenerOptionsLike, EmissionEvent, EventsIteratorOptions,
|
|
|
7
7
|
* Extend this class to create custom event emitters with typed events.
|
|
8
8
|
* The class provides:
|
|
9
9
|
* - DOM EventTarget compatible API (addEventListener, removeEventListener, dispatchEvent)
|
|
10
|
-
* - TC39 Observable
|
|
10
|
+
* - TC39 Observable interoperability (subscribe, Symbol.observable)
|
|
11
11
|
* - Async iteration support (events() method)
|
|
12
12
|
* - Wildcard listeners for namespaced events
|
|
13
13
|
* - Lifecycle management (complete(), completed)
|
|
@@ -39,7 +39,7 @@ import type { AddEventListenerOptionsLike, EmissionEvent, EventsIteratorOptions,
|
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
|
-
* @example TC39 Observable
|
|
42
|
+
* @example TC39 Observable interoperability
|
|
43
43
|
* ```typescript
|
|
44
44
|
* const service = new UserService();
|
|
45
45
|
*
|
|
@@ -67,7 +67,7 @@ import type { AddEventListenerOptionsLike, EmissionEvent, EventsIteratorOptions,
|
|
|
67
67
|
export declare abstract class EventEmission<E extends Record<string, any>> {
|
|
68
68
|
#private;
|
|
69
69
|
/**
|
|
70
|
-
* Returns this observable for Symbol.observable
|
|
70
|
+
* Returns this observable for Symbol.observable interoperability.
|
|
71
71
|
*/
|
|
72
72
|
[SymbolObservable]: () => ObservableLike<EmissionEvent<E[keyof E]>>;
|
|
73
73
|
constructor();
|
|
@@ -75,25 +75,25 @@ export declare abstract class EventEmission<E extends Record<string, any>> {
|
|
|
75
75
|
* Adds an event listener for the specified event type.
|
|
76
76
|
* Returns an unsubscribe function for convenience.
|
|
77
77
|
*/
|
|
78
|
-
addEventListener<K extends keyof E & string>(type: K, listener:
|
|
78
|
+
addEventListener<K extends keyof E & string>(type: K, listener: EventListenerLike<EmissionEvent<E[K], K>> | null, options?: AddEventListenerOptionsLike | boolean): () => void;
|
|
79
79
|
/**
|
|
80
80
|
* Removes an event listener for the specified event type.
|
|
81
81
|
*/
|
|
82
|
-
removeEventListener<K extends keyof E & string>(type: K, listener:
|
|
82
|
+
removeEventListener<K extends keyof E & string>(type: K, listener: EventListenerLike<EmissionEvent<E[K], K>> | null, options?: EventListenerOptionsLike | boolean): void;
|
|
83
83
|
/**
|
|
84
84
|
* Dispatches an event to all registered listeners.
|
|
85
85
|
* Returns false if the emitter has been completed, true otherwise.
|
|
86
86
|
*/
|
|
87
|
-
dispatchEvent<K extends keyof E & string>(event:
|
|
87
|
+
dispatchEvent<K extends keyof E & string>(event: DispatchEventInput<E[K], K> | DOMEventLike): boolean;
|
|
88
88
|
/**
|
|
89
89
|
* Returns an observable for the specified event type.
|
|
90
90
|
*/
|
|
91
|
-
on<K extends keyof E & string>(type: K, options?: OnOptions | boolean): ObservableLike<EmissionEvent<E[K]>>;
|
|
91
|
+
on<K extends keyof E & string>(type: K, options?: OnOptions | boolean): ObservableLike<EmissionEvent<E[K], K>>;
|
|
92
92
|
/**
|
|
93
93
|
* Adds a one-time listener for the specified event type.
|
|
94
94
|
* Returns an unsubscribe function.
|
|
95
95
|
*/
|
|
96
|
-
once<K extends keyof E & string>(type: K, listener:
|
|
96
|
+
once<K extends keyof E & string>(type: K, listener: EventListenerLike<EmissionEvent<E[K], K>> | null, options?: Omit<AddEventListenerOptionsLike, 'once'> | boolean): () => void;
|
|
97
97
|
/**
|
|
98
98
|
* Removes all listeners, or those of the specified event type.
|
|
99
99
|
*/
|
|
@@ -104,10 +104,9 @@ export declare abstract class EventEmission<E extends Record<string, any>> {
|
|
|
104
104
|
clear(): void;
|
|
105
105
|
/**
|
|
106
106
|
* Pipe events from this emitter to another target.
|
|
107
|
-
*
|
|
108
|
-
* Events for types registered after piping won't be forwarded automatically.
|
|
107
|
+
* Forwards all events. If mapFn returns null, the event is skipped.
|
|
109
108
|
*/
|
|
110
|
-
pipe<T extends Record<string, any>>(target: EventTargetLike<T>, mapFn?: <K extends keyof E & string>(event: EmissionEvent<E[K]>) =>
|
|
109
|
+
pipe<T extends Record<string, any>>(target: EventTargetLike<T>, mapFn?: <K extends keyof E & string>(event: EmissionEvent<E[K], K>) => DispatchEventInput<T[keyof T & string], keyof T & string> | null): () => void;
|
|
111
110
|
/**
|
|
112
111
|
* Adds a wildcard listener that receives events matching the pattern.
|
|
113
112
|
* Use '*' for all events, or 'namespace:*' for namespaced events.
|
|
@@ -124,7 +123,7 @@ export declare abstract class EventEmission<E extends Record<string, any>> {
|
|
|
124
123
|
/**
|
|
125
124
|
* Subscribes an observer to events of a specific type (typed).
|
|
126
125
|
*/
|
|
127
|
-
subscribe<K extends keyof E & string>(type: K, observerOrNext?: Observer<EmissionEvent<E[K]>> | ((value: EmissionEvent<E[K]>) => void), error?: (err: unknown) => void, completeHandler?: () => void): Subscription;
|
|
126
|
+
subscribe<K extends keyof E & string>(type: K, observerOrNext?: Observer<EmissionEvent<E[K], K>> | ((value: EmissionEvent<E[K], K>) => void), error?: (err: unknown) => void, completeHandler?: () => void): Subscription;
|
|
128
127
|
/**
|
|
129
128
|
* Returns an observable that emits all events.
|
|
130
129
|
*/
|
|
@@ -152,6 +151,6 @@ export declare abstract class EventEmission<E extends Record<string, any>> {
|
|
|
152
151
|
* }
|
|
153
152
|
* ```
|
|
154
153
|
*/
|
|
155
|
-
events<K extends keyof E & string>(type: K, options?: EventsIteratorOptions): AsyncIterableIterator<EmissionEvent<E[K]>>;
|
|
154
|
+
events<K extends keyof E & string>(type: K, options?: EventsIteratorOptions): AsyncIterableIterator<EmissionEvent<E[K], K>>;
|
|
156
155
|
}
|
|
157
156
|
//# sourceMappingURL=event-emission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emission.d.ts","sourceRoot":"","sources":["../src/event-emission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,2BAA2B,EAC3B,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,8BAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;
|
|
1
|
+
{"version":3,"file":"event-emission.d.ts","sourceRoot":"","sources":["../src/event-emission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,cAAc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,GAAG,OAAO,CAAC,IAAI,CAAC,GAC1D,IAAI;IAQP;;OAEG;IACH,SAAS,CACP,cAAc,EACV,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GACnC,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAC/C,YAAY;IAEf;;OAEG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAClC,IAAI,EAAE,CAAC,EACP,cAAc,CAAC,EACX,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAC7C,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EAC9B,eAAe,CAAC,EAAE,MAAM,IAAI,GAC3B,YAAY;IAoDf;;OAEG;IACH,YAAY,IAAI,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAezD;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAIhB;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAMD;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAC/B,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE,qBAAqB,GAC9B,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAGjD"}
|
package/dist/factory.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface CreateEventTargetOptions {
|
|
|
15
15
|
* Extends CreateEventTargetOptions with proxy observation settings.
|
|
16
16
|
*
|
|
17
17
|
* @property observe - Must be true to enable observation mode.
|
|
18
|
-
* @property deep - If true, nested objects are also observed (default:
|
|
18
|
+
* @property deep - If true, nested objects are also observed (default: true).
|
|
19
19
|
* @property cloneStrategy - Strategy for cloning previous state: 'shallow', 'deep', or 'path'.
|
|
20
20
|
*/
|
|
21
21
|
export interface CreateEventTargetObserveOptions extends CreateEventTargetOptions, ObserveOptions {
|
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAIV,eAAe,EAOhB,MAAM,SAAS,CAAC;AAyCjB;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,+BACf,SAAQ,wBAAwB,EAAE,cAAc;IAChD,+CAA+C;IAC/C,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7D,IAAI,CAAC,EAAE,wBAAwB,GAC9B,eAAe,CAAC,CAAC,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAChD,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,+BAA+B,GACpC,CAAC,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC"}
|