16
16
17
17
import { CredentialsProvider } from '../api/credentials' ;
18
18
import { User } from '../auth/user' ;
19
- import { EagerGarbageCollector } from '../local/eager_garbage_collector' ;
20
- import { GarbageCollector } from '../local/garbage_collector' ;
21
19
import { IndexedDbPersistence } from '../local/indexeddb_persistence' ;
22
20
import { LocalStore } from '../local/local_store' ;
23
21
import { MemoryPersistence } from '../local/memory_persistence' ;
24
- import { NoOpGarbageCollector } from '../local/no_op_garbage_collector' ;
25
22
import { Persistence } from '../local/persistence' ;
26
23
import {
27
24
DocumentKeySet ,
@@ -83,7 +80,6 @@ export class FirestoreClient {
83
80
// with the types rather than littering the code with '!' or unnecessary
84
81
// undefined checks.
85
82
private eventMgr : EventManager ;
86
- private garbageCollector : GarbageCollector ;
87
83
private persistence : Persistence ;
88
84
private localStore : LocalStore ;
89
85
private remoteStore : RemoteStore ;
@@ -292,7 +288,6 @@ export class FirestoreClient {
292
288
293
289
// TODO(http://b/33384523): For now we just disable garbage collection
294
290
// when persistence is enabled.
295
- this . garbageCollector = new NoOpGarbageCollector ( ) ;
296
291
const storagePrefix = IndexedDbPersistence . buildStoragePrefix (
297
292
this . databaseInfo
298
293
) ;
@@ -347,8 +342,7 @@ export class FirestoreClient {
347
342
* @returns A promise that will successfully resolve.
348
343
*/
349
344
private startMemoryPersistence ( ) : Promise < void > {
350
- this . garbageCollector = new EagerGarbageCollector ( ) ;
351
- this . persistence = new MemoryPersistence ( this . clientId ) ;
345
+ this . persistence = MemoryPersistence . createEagerPersistence ( this . clientId ) ;
352
346
this . sharedClientState = new MemorySharedClientState ( ) ;
353
347
return Promise . resolve ( ) ;
354
348
}
@@ -363,11 +357,7 @@ export class FirestoreClient {
363
357
return this . platform
364
358
. loadConnection ( this . databaseInfo )
365
359
. then ( async connection => {
366
- this . localStore = new LocalStore (
367
- this . persistence ,
368
- user ,
369
- this . garbageCollector
370
- ) ;
360
+ this . localStore = new LocalStore ( this . persistence , user ) ;
371
361
const serializer = this . platform . newSerializer (
372
362
this . databaseInfo . databaseId
373
363
) ;
0 commit comments