Skip to content

Commit 1b2d3eb

Browse files
Review/Fix build
1 parent 452e460 commit 1b2d3eb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/firestore/src/core/event_manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export interface Observer<T> {
4646
* It handles "fan-out". -- Identical queries will re-use the same watch on the
4747
* backend.
4848
*
49-
* PORTING NOTE: On Web, EventManager requires a call to `subscribe()` to
50-
* register SyncEngine's `listen()` and `unlisten()` functionality. This allows
51-
* users to tree-shake the Watch logic.
49+
* PORTING NOTE: On Web, EventManager `onListen` and `onUnlisten` need to be
50+
* assigned to SyncEngine's `listen()` and `unlisten()` API before usage. This
51+
* allows users to tree-shake the Watch logic.
5252
*/
5353
export class EventManager implements SyncEngineListener {
5454
private queries = new ObjectMap<Query, QueryListenersInfo>(

packages/firestore/src/core/firestore_client.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@ export class FirestoreClient {
283283
this.syncEngine = onlineComponentProvider.syncEngine;
284284
this.eventMgr = onlineComponentProvider.eventManager;
285285

286-
this.eventMgr.subscribe(
287-
syncEngineListen.bind(null, this.syncEngine),
288-
syncEngineUnlisten.bind(null, this.syncEngine)
289-
);
286+
this.eventMgr.onListen = syncEngineListen.bind(null, this.syncEngine);
287+
this.eventMgr.onUnlisten = syncEngineUnlisten.bind(null, this.syncEngine);
290288

291289
// When a user calls clearPersistence() in one client, all other clients
292290
// need to be terminated to allow the delete to succeed.

0 commit comments

Comments
 (0)