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(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<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.

    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)