| id | Subscription |
|---|---|
| title | Subscription |
Defined in: packages/db/src/types.ts:201
Public interface for a collection subscription Used by sync implementations to track subscription lifecycle
EventEmitter<SubscriptionEvents>
readonly status: SubscriptionStatus;Defined in: packages/db/src/types.ts:203
Current status of the subscription
protected clearListeners(): void;Defined in: packages/db/src/event-emitter.ts:115
Clear all listeners
void
EventEmitter.clearListenersprotected emitInner<T>(event, eventPayload): void;Defined in: packages/db/src/event-emitter.ts:96
Internal
Emit an event to all listeners
T extends keyof SubscriptionEvents
T
Event name to emit
Event payload For use by subclasses - subclasses should wrap this with a public emit if needed
void
EventEmitter.emitInneroff<T>(event, callback): void;Defined in: packages/db/src/event-emitter.ts:53
Unsubscribe from an event
T extends keyof SubscriptionEvents
T
Event name to stop listening for
(event) => void
Function to remove
void
EventEmitter.offon<T>(event, callback): () => void;Defined in: packages/db/src/event-emitter.ts:17
Subscribe to an event
T extends keyof SubscriptionEvents
T
Event name to listen for
(event) => void
Function to call when event is emitted
Unsubscribe function
(): void;void
EventEmitter.ononce<T>(event, callback): () => void;Defined in: packages/db/src/event-emitter.ts:37
Subscribe to an event once (automatically unsubscribes after first emission)
T extends keyof SubscriptionEvents
T
Event name to listen for
(event) => void
Function to call when event is emitted
Unsubscribe function
(): void;void
EventEmitter.oncewaitFor<T>(event, timeout?): Promise<SubscriptionEvents[T]>;Defined in: packages/db/src/event-emitter.ts:66
Wait for an event to be emitted
T extends keyof SubscriptionEvents
T
Event name to wait for
number
Optional timeout in milliseconds
Promise<SubscriptionEvents[T]>
Promise that resolves with the event payload
EventEmitter.waitFor