Fix bad snapshot initialisation

This commit is contained in:
Cooldude2606 committed 2026-05-29 19:15:27 +01:00
1 parent e54b292fce
commit 11b8a0ff97
1 file changed
+1 -1
+1 -1
View File
@@ -401,7 +401,7 @@ export class EventSubscriber<E, S = null> {
/** True if this subscriber is currently synced with the source */
synced = false;
/** Repeat calls to getSnapshot will return the same readonly copy unless values has updated */
private _snapshot: readonly [S, boolean] = [null as S, false];
private _snapshot: readonly [S, boolean] = [this.makeSnapshot(), false];
private _snapshotLastUpdatedMs = -1;
/** Callbacks will be called when an event is received or the synced state changes */
private _callbacks = new Array<EventSubscriberCallback<E>>();