Collection

extension Collection where Element == AfterReducer

Available where Element == AfterReducer

  • Reduces a collection of AfterReducer closures into a single AfterReducer closure. Useful when a group of middlewares ran, we collected their AfterReducer operations in an Array and now we want to merge everything into a single AfterReducer closure to execute all of them once the reducer pipeline has finished and new state is published. The composition will happen in the reversed order of the closures in the array, because we want the first middleware to be the last notified after reducer.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `MiddlewareProtocol` instead of `Middleware`. It doesn't use `AfterReducer`. This extension will be removed on 1.0.")
    public func asAfterReducer() -> AfterReducer