docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class StoreFactory

    Factory methods to create Redux stores.

    Inheritance
    object
    StoreFactory
    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 static class StoreFactory

    Methods

    ApplyMiddleware<TState>(params Middleware<TState>[])

    Apply middlewares to the store.

    Declaration
    public static StoreEnhancer<TState> ApplyMiddleware<TState>(params Middleware<TState>[] middlewares)
    Parameters
    Type Name Description
    Middleware<TState>[] middlewares

    The middlewares to apply.

    Returns
    Type Description
    StoreEnhancer<TState>

    A new store enhancer.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    CombineReducers<TState>(IEnumerable<Reducer<TState>>)

    Create a reducer that combines multiple reducers into one.

    Declaration
    public static Reducer<TState> CombineReducers<TState>(IEnumerable<Reducer<TState>> reducers)
    Parameters
    Type Name Description
    IEnumerable<Reducer<TState>> reducers

    The reducers to combine.

    Returns
    Type Description
    Reducer<TState>

    A reducer that combines the given reducers.

    Type Parameters
    Name Description
    TState

    The type of the state.

    CombineReducers<TState>(IReadOnlyCollection<ISlice<TState>>)

    Create a reducer that combines multiple slices into one.

    Declaration
    public static Reducer<TState> CombineReducers<TState>(IReadOnlyCollection<ISlice<TState>> slices)
    Parameters
    Type Name Description
    IReadOnlyCollection<ISlice<TState>> slices

    The slices to combine.

    Returns
    Type Description
    Reducer<TState>

    A reducer that combines the given slices.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    CombineReducers<TState>(params Reducer<TState>[])

    Create a reducer that combines multiple reducers into one.

    Declaration
    public static Reducer<TState> CombineReducers<TState>(params Reducer<TState>[] reducers)
    Parameters
    Type Name Description
    Reducer<TState>[] reducers

    The reducers to combine.

    Returns
    Type Description
    Reducer<TState>

    A reducer that combines the given reducers.

    Type Parameters
    Name Description
    TState

    The type of the state.

    ComposeEnhancers<TState>(params StoreEnhancer<TState>[])

    Compose enhancers into a single enhancer.

    Declaration
    public static StoreEnhancer<TState> ComposeEnhancers<TState>(params StoreEnhancer<TState>[] enhancers)
    Parameters
    Type Name Description
    StoreEnhancer<TState>[] enhancers

    The enhancers to compose.

    Returns
    Type Description
    StoreEnhancer<TState>

    A new store enhancer.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    CreateSlice<TState>(string, TState, Action<SliceReducerSwitchBuilder<TState>>, Action<ReducerSwitchBuilder<TState>>)

    Create a new state slice. A state slice is a part of the state tree. You can provide reducers that will "own" the state slice at the same time.

    Declaration
    public static Slice<TState, PartitionedState> CreateSlice<TState>(string name, TState initialState, Action<SliceReducerSwitchBuilder<TState>> reducers, Action<ReducerSwitchBuilder<TState>> extraReducers = null)
    Parameters
    Type Name Description
    string name

    The name of the state slice.

    TState initialState

    The initial state of the state slice.

    Action<SliceReducerSwitchBuilder<TState>> reducers

    The reducers that will "own" the state slice.

    Action<ReducerSwitchBuilder<TState>> extraReducers

    The reducers that will be called if the action type does not match any of the main reducers.

    Returns
    Type Description
    Slice<TState, PartitionedState>

    A slice object that can be used to access the state slice.

    Type Parameters
    Name Description
    TState

    The type of the slice state.

    Remarks

    You can also provide extra reducers that will be called if the action type does not match any of the main reducers.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the name is null or empty.

    CreateStore(IReadOnlyCollection<ISlice<PartitionedState>>, StoreEnhancer<PartitionedState>)

    Creates a Redux store composed of multiple slices.

    Declaration
    public static IStore<PartitionedState> CreateStore(IReadOnlyCollection<ISlice<PartitionedState>> slices, StoreEnhancer<PartitionedState> enhancer = null)
    Parameters
    Type Name Description
    IReadOnlyCollection<ISlice<PartitionedState>> slices

    The slices that compose the store.

    StoreEnhancer<PartitionedState> enhancer

    The enhancer for the store.

    Returns
    Type Description
    IStore<PartitionedState>

    The new store.

    Remarks

    This is a specialization of CreateStore<TState>(IReadOnlyCollection<ISlice<TState>>, StoreEnhancer<TState>) for a Store<TStoreState> that uses PartitionedState.

    CreateStore(Reducer<PartitionedState>, PartitionedState, StoreEnhancer<PartitionedState>)

    Creates a Redux store that holds the complete state tree of your app.

    Declaration
    public static IStore<PartitionedState> CreateStore(Reducer<PartitionedState> rootReducer, PartitionedState initialState = null, StoreEnhancer<PartitionedState> enhancer = null)
    Parameters
    Type Name Description
    Reducer<PartitionedState> rootReducer

    The root reducer of the store.

    PartitionedState initialState

    The initial state of the store.

    StoreEnhancer<PartitionedState> enhancer

    The enhancer for the store.

    Returns
    Type Description
    IStore<PartitionedState>

    A new store.

    Remarks

    This is a specialization of CreateStore<TState>(Reducer<TState>, TState, StoreEnhancer<TState>) for a Store<TStoreState> that uses PartitionedState.

    CreateStore<TState>(IReadOnlyCollection<ISlice<TState>>, StoreEnhancer<TState>)

    Creates a Redux store composed of multiple slices.

    Declaration
    public static IStore<TState> CreateStore<TState>(IReadOnlyCollection<ISlice<TState>> slices, StoreEnhancer<TState> enhancer = null) where TState : IPartionableState<TState>, new()
    Parameters
    Type Name Description
    IReadOnlyCollection<ISlice<TState>> slices

    The slices that compose the store.

    StoreEnhancer<TState> enhancer

    The enhancer for the store.

    Returns
    Type Description
    IStore<TState>

    The new store.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the slices are null.

    CreateStore<TState>(Reducer<TState>, TState, StoreEnhancer<TState>)

    Creates a Redux store that holds the complete state tree of your app.

    Declaration
    public static IStore<TState> CreateStore<TState>(Reducer<TState> rootReducer, TState initialState = default, StoreEnhancer<TState> enhancer = null) where TState : new()
    Parameters
    Type Name Description
    Reducer<TState> rootReducer

    The root reducer of the store.

    TState initialState

    The initial state of the store.

    StoreEnhancer<TState> enhancer

    The enhancer for the store.

    Returns
    Type Description
    IStore<TState>

    A new store.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    DefaultEnhancer<TState>(DefaultEnhancerConfiguration)

    Get the default enhancer for the store.

    Declaration
    public static StoreEnhancer<TState> DefaultEnhancer<TState>(DefaultEnhancerConfiguration cfg = null)
    Parameters
    Type Name Description
    DefaultEnhancerConfiguration cfg

    The configuration for the default enhancer.

    Returns
    Type Description
    StoreEnhancer<TState>

    The default enhancer.

    Type Parameters
    Name Description
    TState

    The type of the store state.

    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)