mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Distinguish distinctUntilChanged from distinctUntilDatabaseChanged
This commit is contained in:
1 parent
82329c899e
commit
1e72731c07
3 files changed
+7
-7
No files matched your search
@@ -124,7 +124,7 @@ public struct DatabaseValuesReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ dbValues: [DatabaseValue]) -> [Request.RowDecoder]? {
|
||||
if let previousDbValues = previousDbValues, previousDbValues == dbValues {
|
||||
// Don't notify consecutive identical dbValue arrays
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousDbValues = dbValues
|
||||
@@ -158,7 +158,7 @@ public struct DatabaseValueReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ dbValue: DatabaseValue?) -> Request.RowDecoder?? {
|
||||
if let previousDbValue = previousDbValue, previousDbValue == dbValue {
|
||||
// Don't notify consecutive identical dbValue
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousDbValue = dbValue
|
||||
@@ -169,7 +169,7 @@ public struct DatabaseValueReducer<Request: FetchRequest>: ValueReducer
|
||||
return .some(value)
|
||||
} else if previousValueWasNil {
|
||||
// Don't notify consecutive nil values
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
} else {
|
||||
previousValueWasNil = true
|
||||
@@ -203,7 +203,7 @@ public struct OptionalDatabaseValuesReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ dbValues: [DatabaseValue]) -> [Request.RowDecoder._Wrapped?]? {
|
||||
if let previousDbValues = previousDbValues, previousDbValues == dbValues {
|
||||
// Don't notify consecutive identical dbValue arrays
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousDbValues = dbValues
|
||||
|
||||
@@ -91,7 +91,7 @@ public struct FetchableRecordsReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ rows: [Row]) -> [Request.RowDecoder]? {
|
||||
if let previousRows = previousRows, previousRows == rows {
|
||||
// Don't notify consecutive identical row arrays
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousRows = rows
|
||||
@@ -122,7 +122,7 @@ public struct FetchableRecordReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ row: Row?) -> Request.RowDecoder?? {
|
||||
if let previousRow = previousRow, previousRow == row {
|
||||
// Don't notify consecutive identical rows
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousRow = row
|
||||
|
||||
@@ -120,7 +120,7 @@ public struct RowReducer<Request: FetchRequest>: ValueReducer
|
||||
public mutating func value(_ row: Row?) -> Row?? {
|
||||
if let previousRow = previousRow, previousRow == row {
|
||||
// Don't notify consecutive identical rows
|
||||
// TODO: Remove this implicit `distinctUntilChanged` in GRDB 4
|
||||
// TODO: Remove this implicit `distinctUntilDatabaseChanged` in GRDB 4
|
||||
return nil
|
||||
}
|
||||
self.previousRow = row
|
||||
|
||||
Reference in new issue
Block a user