docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ReducerSwitchBuilder<TState>

    The Reducer Switch Builder is used to build a reducer switch statement via method chaining. You must have created Action Creators for each action type you want to handle prior to using this.

    Inheritance
    object
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>
    ReducerSwitchBuilder<TState>
    Implements
    ISwitchBuilder<ReducerSwitchBuilder<TState>, TState>
    ISwitchMatchBuilder<ReducerSwitchBuilder<TState>, TState>
    Inherited Members
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.m_ActionTypes
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.ValidateCase(IActionCreator, object)
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.AddCase(IActionCreator, Reducer<TState>)
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.AddCase<TPayload>(IActionCreator<TPayload>, Reducer<TPayload, TState>)
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.GetActionCreators()
    SwitchBuilder<ReducerSwitchBuilder<TState>, TState>.GetReducer()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Redux
    Assembly: Unity.AppUI.Redux.dll
    Syntax
    public class ReducerSwitchBuilder<TState> : SwitchBuilder<ReducerSwitchBuilder<TState>, TState>, ISwitchBuilder<ReducerSwitchBuilder<TState>, TState>, ISwitchMatchBuilder<ReducerSwitchBuilder<TState>, TState>
    Type Parameters
    Name Description
    TState

    The type of the state slice.

    Methods

    AddCase(ActionCreator, CaseReducer<TState>)

    Adds a case to the reducer switch statement.

    Declaration
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddCase(ActionCreator action, CaseReducer<TState> reducer)
    Parameters
    Type Name Description
    ActionCreator action

    The action creator for the action type you want to handle.

    CaseReducer<TState> reducer

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

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    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
    public ReducerSwitchBuilder<TState> 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
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    AddCase<T>(ActionCreator<T>, CaseReducer<T, TState>)

    Adds a case to the reducer switch statement.

    Declaration
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddCase<T>(ActionCreator<T> action, CaseReducer<T, TState> reducer)
    Parameters
    Type Name Description
    ActionCreator<T> action

    The action creator for the action type you want to handle.

    CaseReducer<T, TState> reducer

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

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    Type Parameters
    Name Description
    T

    The type of the action payload.

    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
    public ReducerSwitchBuilder<TState> 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
    ReducerSwitchBuilder<TState>

    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
    public ReducerSwitchBuilder<TState> AddDefault(Reducer<TState> reducer)
    Parameters
    Type Name Description
    Reducer<TState> reducer

    The reducer function for the default case.

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    AddDefaultCase(CaseReducer<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
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddDefaultCase(CaseReducer<TState> reducer)
    Parameters
    Type Name Description
    CaseReducer<TState> reducer

    The reducer function for the default case.

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    AddDefaultCase<T>(CaseReducer<T, 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
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddDefaultCase<T>(CaseReducer<T, TState> reducer)
    Parameters
    Type Name Description
    CaseReducer<T, TState> reducer

    The reducer function for the default case.

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    Type Parameters
    Name Description
    T

    The type of the action payload.

    AddMatcher(ActionMatcher, CaseReducer<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
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddMatcher(ActionMatcher actionMatcher, CaseReducer<TState> reducer)
    Parameters
    Type Name Description
    ActionMatcher actionMatcher

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

    CaseReducer<TState> reducer

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

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    AddMatcher<T>(ActionMatcher, CaseReducer<T, 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
    [Obsolete]
    public ReducerSwitchBuilder<TState> AddMatcher<T>(ActionMatcher actionMatcher, CaseReducer<T, TState> reducer)
    Parameters
    Type Name Description
    ActionMatcher actionMatcher

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

    CaseReducer<T, TState> reducer

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

    Returns
    Type Description
    ReducerSwitchBuilder<TState>

    The Reducer Switch Builder.

    Type Parameters
    Name Description
    T

    The type of the action payload.

    BuildReducer(TState)

    Builds the reducer switch statement.

    Declaration
    [Obsolete("BuildReducer is deprecated.")]
    public Reducer BuildReducer(TState initialState)
    Parameters
    Type Name Description
    TState initialState

    The initial state of the reducer.

    Returns
    Type Description
    Reducer

    The reducer switch statement.

    Implements

    ISwitchBuilder<TBuilder, TState>
    ISwitchMatchBuilder<TBuilder, TState>
    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)