docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ISwitchMatchBuilder<TBuilder, TState>

    A switch statement builder that can be used to build a switch statement for a reducer.

    Namespace: Unity.AppUI.Redux
    Assembly: Unity.AppUI.Redux.dll
    Syntax
    public interface ISwitchMatchBuilder<out TBuilder, TState>
    Type Parameters
    Name Description
    TBuilder

    The type of the builder.

    TState

    The type of the state.

    Methods

    AddCase(ActionMatcher, Reducer<TState>)

    Adds a matcher case to the reducer switch statement. A matcher case is a case that will be executed if the action type matches the predicate.

    Declaration
    TBuilder AddCase(ActionMatcher actionMatcher, Reducer<TState> reducer)
    Parameters
    Type Name Description
    ActionMatcher actionMatcher

    The predicate that will be used to match the action type.

    Reducer<TState> reducer

    The reducer function for the action type you want to handle.

    Returns
    Type Description
    TBuilder

    The Reducer Switch Builder.

    AddCase<TPayload>(ActionMatcher, Reducer<TPayload, TState>)

    Adds a matcher case to the reducer switch statement. A matcher case is a case that will be executed if the action type matches the predicate.

    Declaration
    TBuilder AddCase<TPayload>(ActionMatcher actionMatcher, Reducer<TPayload, TState> reducer)
    Parameters
    Type Name Description
    ActionMatcher actionMatcher

    The predicate that will be used to match the action type.

    Reducer<TPayload, TState> reducer

    The reducer function for the action type you want to handle.

    Returns
    Type Description
    TBuilder

    The Reducer Switch Builder.

    Type Parameters
    Name Description
    TPayload

    The type of the action payload.

    AddDefault(Reducer<TState>)

    Adds a default case to the reducer switch statement. A default case is a case that will be executed if no other cases match.

    Declaration
    TBuilder AddDefault(Reducer<TState> reducer)
    Parameters
    Type Name Description
    Reducer<TState> reducer

    The reducer function for the default case.

    Returns
    Type Description
    TBuilder

    The Reducer Switch Builder.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)