AnyValueReducer
public struct AnyValueReducer<Fetched, Value> : ValueReducerA type-erased ValueReducer.
An AnyValueReducer forwards its operations to an underlying reducer, hiding its specifics.
- 
                  
                  Creates a reducer whose fetch(_:)andvalue(_:)methods wrap and forward operations the argument closures.For example, this reducer counts the number of a times the player table is modified: var count = 0 let reducer = AnyValueReducer( fetch: { _ in }, value: { _ -> Int? in count += 1 return count }) let observer = ValueObservation .tracking(Player.all(), reducer: reducer) .start(in: dbQueue) { count: Int in print("Players have been modified \(count) times.") }DeclarationSwift public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?)
- 
                  
                  Creates a reducer that wraps and forwards operations to reducer.DeclarationSwift public init<Base>(_ reducer: Base) where Fetched == Base.Fetched, Value == Base.Value, Base : ValueReducer
 View on GitHub
View on GitHub Install in Dash
Install in Dash AnyValueReducer Structure Reference
        AnyValueReducer Structure Reference