ValueReducer
public protocol ValueReducer
The ValueReducer protocol supports ValueObservation.
-
The type of fetched database values
Declaration
Swift
associatedtype Fetched
-
The type of observed values
Declaration
Swift
associatedtype Value
-
Feches database values upon changes in an observed database region.
-
Transforms a fetched value into an eventual observed value. Returns nil when observer should not be notified.
This method runs inside a private dispatch queue.
-
compactMap(_:)
Extension methodReturns a reducer which outputs the non-nil results of calling the given transformation which each element emitted by this reducer.
Declaration
Swift
public func compactMap<T>(_ transform: @escaping (Value) -> T?) -> ValueReducers.CompactMap<Self, T>
-
map(_:)
Extension methodReturns a reducer which outputs the results of calling the given transformation which each element emitted by this reducer.
Declaration
Swift
public func map<T>(_ transform: @escaping (Value) -> T) -> ValueReducers.Map<Self, T>
-
distinctUntilChanged()
Extension methodReturns a ValueReducer which filters out consecutive equal values.
Declaration
Swift
@available(*, deprecated, renamed: "removeDuplicates") public func distinctUntilChanged() -> ValueReducers.RemoveDuplicates<Self>
-
removeDuplicates()
Extension methodReturns a ValueReducer which filters out consecutive equal values.
Declaration
Swift
public func removeDuplicates() -> ValueReducers.RemoveDuplicates<Self>