Skip to content

Commit

Permalink
Make LocalStore an interface. (#3269)
Browse files Browse the repository at this point in the history
* Make local store an interface.

* Address comments
  • Loading branch information
wu-hui authored Jun 24, 2020
1 parent 5de3ec6 commit 9cf49f7
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 112 deletions.
11 changes: 8 additions & 3 deletions packages/firestore/src/core/component_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import {
SharedClientState,
WebStorageSharedClientState
} from '../local/shared_client_state';
import { LocalStore, MultiTabLocalStore } from '../local/local_store';
import {
LocalStore,
MultiTabLocalStore,
newLocalStore,
newMultiTabLocalStore
} from '../local/local_store';
import { MultiTabSyncEngine, SyncEngine } from './sync_engine';
import { RemoteStore } from '../remote/remote_store';
import { EventManager } from './event_manager';
Expand Down Expand Up @@ -126,7 +131,7 @@ export class MemoryComponentProvider implements ComponentProvider {
}

createLocalStore(cfg: ComponentConfiguration): LocalStore {
return new LocalStore(
return newLocalStore(
this.persistence,
new IndexFreeQueryEngine(),
cfg.initialUser
Expand Down Expand Up @@ -212,7 +217,7 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
}

createLocalStore(cfg: ComponentConfiguration): LocalStore {
return new MultiTabLocalStore(
return newMultiTabLocalStore(
this.persistence,
new IndexFreeQueryEngine(),
cfg.initialUser
Expand Down
Loading

0 comments on commit 9cf49f7

Please sign in to comment.