@@ -1054,9 +1054,10 @@ export function lookupMutationDocuments(
1054
1054
localStore : LocalStore ,
1055
1055
batchId : BatchId
1056
1056
) : Promise < MaybeDocumentMap | null > {
1057
- const localStoreImpl = debugCast ( localStore , LocalStoreImpl ) ;
1058
- const mutationQueueImpl = debugCast (
1059
- localStoreImpl . mutationQueue ,
1057
+ const [ localStoreImpl , mutationQueueImpl ] = debugCast (
1058
+ localStore ,
1059
+ LocalStoreImpl ,
1060
+ ( localStore as LocalStoreImpl ) . mutationQueue ,
1060
1061
IndexedDbMutationQueue // We only support IndexedDb in multi-tab mode.
1061
1062
) ;
1062
1063
return localStoreImpl . persistence . runTransaction (
@@ -1082,9 +1083,8 @@ export function removeCachedMutationBatchMetadata(
1082
1083
localStore : LocalStore ,
1083
1084
batchId : BatchId
1084
1085
) : void {
1085
- const localStoreImpl = debugCast ( localStore , LocalStoreImpl ) ;
1086
1086
const mutationQueueImpl = debugCast (
1087
- localStoreImpl . mutationQueue ,
1087
+ debugCast ( localStore , LocalStoreImpl ) . mutationQueue ,
1088
1088
IndexedDbMutationQueue // We only support IndexedDb in multi-tab mode.
1089
1089
) ;
1090
1090
mutationQueueImpl . removeCachedMutationKeys ( batchId ) ;
@@ -1094,9 +1094,8 @@ export function removeCachedMutationBatchMetadata(
1094
1094
export function getCurrentlyActiveClients (
1095
1095
localStore : LocalStore
1096
1096
) : Promise < ClientId [ ] > {
1097
- const localStoreImpl = debugCast ( localStore , LocalStoreImpl ) ;
1098
1097
const persistenceImpl = debugCast (
1099
- localStoreImpl . persistence ,
1098
+ debugCast ( localStore , LocalStoreImpl ) . persistence ,
1100
1099
IndexedDbPersistence // We only support IndexedDb in multi-tab mode.
1101
1100
) ;
1102
1101
return persistenceImpl . getActiveClients ( ) ;
@@ -1107,9 +1106,10 @@ export function getCachedTarget(
1107
1106
localStore : LocalStore ,
1108
1107
targetId : TargetId
1109
1108
) : Promise < Target | null > {
1110
- const localStoreImpl = debugCast ( localStore , LocalStoreImpl ) ;
1111
- const targetCacheImpl = debugCast (
1112
- localStoreImpl . targetCache ,
1109
+ const [ localStoreImpl , targetCacheImpl ] = debugCast (
1110
+ localStore ,
1111
+ LocalStoreImpl ,
1112
+ ( localStore as LocalStoreImpl ) . targetCache ,
1113
1113
IndexedDbTargetCache // We only support IndexedDb in multi-tab mode.
1114
1114
) ;
1115
1115
const cachedTargetData = localStoreImpl . targetDataByTarget . get ( targetId ) ;
@@ -1131,16 +1131,17 @@ export function getCachedTarget(
1131
1131
/**
1132
1132
* Returns the set of documents that have been updated since the last call.
1133
1133
* If this is the first call, returns the set of changes since client
1134
- * initialization. Further invocations will return document changes since
1135
- * the point of rejection .
1134
+ * initialization. Further invocations will return document that have changed
1135
+ * since the prior call .
1136
1136
*/
1137
1137
// PORTING NOTE: Multi-Tab only.
1138
1138
export function getNewDocumentChanges (
1139
1139
localStore : LocalStore
1140
1140
) : Promise < MaybeDocumentMap > {
1141
- const localStoreImpl = debugCast ( localStore , LocalStoreImpl ) ;
1142
- const remoteDocumentCacheImpl = debugCast (
1143
- localStoreImpl . remoteDocuments ,
1141
+ const [ localStoreImpl , remoteDocumentCacheImpl ] = debugCast (
1142
+ localStore ,
1143
+ LocalStoreImpl ,
1144
+ ( localStore as LocalStoreImpl ) . remoteDocuments ,
1144
1145
IndexedDbRemoteDocumentCache // We only support IndexedDb in multi-tab mode.
1145
1146
) ;
1146
1147
return localStoreImpl . persistence
@@ -1157,8 +1158,8 @@ export function getNewDocumentChanges(
1157
1158
}
1158
1159
1159
1160
/**
1160
- * Reads the newest document change from persistence and forwards the internal
1161
- * synchronization marker so that calls to `getNewDocumentChanges()`
1161
+ * Reads the newest document change from persistence and moves the internal
1162
+ * synchronization marker forward so that calls to `getNewDocumentChanges()`
1162
1163
* only return changes that happened after client initialization.
1163
1164
*/
1164
1165
// PORTING NOTE: Multi-Tab only.
0 commit comments