Support refreshDueToExternalTransaction in more views

This commit is contained in:
Ali
2021-11-04 21:09:34 +04:00
parent 9290df840d
commit ddb0999af0
36 changed files with 407 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ public protocol PostboxView {
protocol MutablePostboxView {
func replay(postbox: PostboxImpl, transaction: PostboxTransaction) -> Bool
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool
func immutableView() -> PostboxView
}
@@ -24,6 +25,16 @@ final class CombinedMutableView {
}
return updated
}
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
var updated = false
for (_, view) in self.views {
if view.refreshDueToExternalTransaction(postbox: postbox) {
updated = true
}
}
return updated
}
func immutableView() -> CombinedView {
var result: [PostboxViewKey: PostboxView] = [:]