Interface ISlice<TStoreState>
Base interface for a slice.
Namespace: Unity.AppUI.Redux
Assembly: Unity.AppUI.Redux.dll
Syntax
public interface ISlice<TStoreState>
Type Parameters
Name | Description |
---|---|
TStoreState | The type of the store state. |
Methods
InitializeState(TStoreState)
Set the initial state of the slice. This is used internally by Unity.AppUI.Redux.Store.CreateStore``2(System.Collections.Generic.IReadOnlyCollection{Unity.AppUI.Redux.ISlice{``1}},Unity.AppUI.Redux.StoreEnhancer{Unity.AppUI.Redux.Store{``1}.CreationContext,``1}).
Declaration
TStoreState InitializeState(TStoreState state)
Parameters
Type | Name | Description |
---|---|---|
TStoreState | state | The initial state of the store. |
Returns
Type | Description |
---|---|
TStoreState | The new state of the store. |
Reduce(TStoreState, IAction)
The wrapped reducer of the slice for being used in the store.
Declaration
TStoreState Reduce(TStoreState state, IAction action)
Parameters
Type | Name | Description |
---|---|---|
TStoreState | state | The current state of the store. |
IAction | action | The action to apply to the state. |
Returns
Type | Description |
---|---|
TStoreState | The new state of the store. |