Other Functions

The following functions are available globally.

  • Chain two actions together as a composite type.

    Declaration

    Swift

    @inlinable
    public func + (lhs: Action, rhs: Action) -> CompositeAction

    Parameters

    lhs

    The first action.

    rhs

    The next action.

    Return Value

    A composite action.

  • Compose two middleware together.

    Declaration

    Swift

    @inlinable
    public func + <M1, M2>(previousMiddleware: M1, _ nextMiddleware: M2) -> CompositeMiddleware<M1.State, M1, M2>
    where M1: Middleware, M2: Middleware, M1.State == M2.State

    Parameters

    previousMiddleware

    The middleware to be called first.

    nextMiddleware

    The next middleware to call.

    Return Value

    The combined middleware.

  • Compose two reducers together.

    Declaration

    Swift

    @inlinable
    public func + <R1, R2>(previousReducer: R1, _ nextReducer: R2) -> CompositeReducer<R1.State, R1, R2>
    where R1: Reducer, R2: Reducer, R1.State == R2.State

    Parameters

    previousReducer

    The first reducer to be called.

    nextReducer

    The second reducer to be called.

    Return Value

    A combined reducer.