docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SliceReducerSwitchBuilder<TState>

    The Slice Reducer Switch Builder is used to build a reducer switch statement via method chaining. This builder does not require you to create Action Creators. It will automatically create them for you.

    Inheritance
    object
    SliceReducerSwitchBuilder<TState>
    Inherited Members
    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 SliceReducerSwitchBuilder<TState>
    Type Parameters
    Name Description
    TState

    The type of the state slice.

    Constructors

    SliceReducerSwitchBuilder(string)

    Creates a new Slice Reducer Switch Builder.

    Declaration
    public SliceReducerSwitchBuilder(string name)
    Parameters
    Type Name Description
    string name

    The name of the slice.

    Properties

    name

    The name of the slice.

    Declaration
    public string name { get; }
    Property Value
    Type Description
    string

    Methods

    Add(string, CaseReducer<TState>)

    Adds a case to the reducer switch statement.

    Declaration
    public SliceReducerSwitchBuilder<TState> Add(string actionType, CaseReducer<TState> reducer)
    Parameters
    Type Name Description
    string actionType

    The action type you want to handle.

    CaseReducer<TState> reducer

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

    Returns
    Type Description
    SliceReducerSwitchBuilder<TState>

    The Slice Reducer Switch Builder.

    Add(CaseReducer<TState>)

    Adds a case to the reducer switch statement.

    Declaration
    public SliceReducerSwitchBuilder<TState> Add(CaseReducer<TState> reducer)
    Parameters
    Type Name Description
    CaseReducer<TState> reducer

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

    Returns
    Type Description
    SliceReducerSwitchBuilder<TState>

    The Slice Reducer Switch Builder.

    Add<T>(string, CaseReducer<T, TState>)

    Adds a case to the reducer switch statement.

    Declaration
    public SliceReducerSwitchBuilder<TState> Add<T>(string actionType, CaseReducer<T, TState> reducer)
    Parameters
    Type Name Description
    string actionType

    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
    SliceReducerSwitchBuilder<TState>

    The Slice Reducer Switch Builder.

    Type Parameters
    Name Description
    T

    The type of the payload.

    Add<T>(CaseReducer<T, TState>)

    Adds a case to the reducer switch statement.

    Declaration
    public SliceReducerSwitchBuilder<TState> Add<T>(CaseReducer<T, TState> reducer)
    Parameters
    Type Name Description
    CaseReducer<T, TState> reducer

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

    Returns
    Type Description
    SliceReducerSwitchBuilder<TState>

    The Slice Reducer Switch Builder.

    Type Parameters
    Name Description
    T

    The type of the payload.

    BuildReducers(IEnumerable<ActionCreator>)

    Build the reducer switch statement.

    Declaration
    public Action<ReducerSwitchBuilder<TState>> BuildReducers(IEnumerable<ActionCreator> actionCreatorCollection)
    Parameters
    Type Name Description
    IEnumerable<ActionCreator> actionCreatorCollection

    The collection of Action Creators.

    Returns
    Type Description
    Action<ReducerSwitchBuilder<TState>>

    The reducer switch statement.

    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)