Skip to content

Commit 9cf49f7

Browse files
authored
Make LocalStore an interface. (#3269)
* Make local store an interface. * Address comments
1 parent 5de3ec6 commit 9cf49f7

File tree

3 files changed

+212
-112
lines changed

3 files changed

+212
-112
lines changed

packages/firestore/src/core/component_provider.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import {
2121
SharedClientState,
2222
WebStorageSharedClientState
2323
} from '../local/shared_client_state';
24-
import { LocalStore, MultiTabLocalStore } from '../local/local_store';
24+
import {
25+
LocalStore,
26+
MultiTabLocalStore,
27+
newLocalStore,
28+
newMultiTabLocalStore
29+
} from '../local/local_store';
2530
import { MultiTabSyncEngine, SyncEngine } from './sync_engine';
2631
import { RemoteStore } from '../remote/remote_store';
2732
import { EventManager } from './event_manager';
@@ -126,7 +131,7 @@ export class MemoryComponentProvider implements ComponentProvider {
126131
}
127132

128133
createLocalStore(cfg: ComponentConfiguration): LocalStore {
129-
return new LocalStore(
134+
return newLocalStore(
130135
this.persistence,
131136
new IndexFreeQueryEngine(),
132137
cfg.initialUser
@@ -212,7 +217,7 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
212217
}
213218

214219
createLocalStore(cfg: ComponentConfiguration): LocalStore {
215-
return new MultiTabLocalStore(
220+
return newMultiTabLocalStore(
216221
this.persistence,
217222
new IndexFreeQueryEngine(),
218223
cfg.initialUser

0 commit comments

Comments
 (0)