Class PartitionedState
A partitioned state. This is the specialization of a state that is partitioned into multiple slices.
Implements
Inherited Members
Namespace: Unity.AppUI.Redux
Assembly: Unity.AppUI.Redux.dll
Syntax
[Serializable]
public class PartitionedState : Dictionary<string, object>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, IPartionableState<PartitionedState>, IPartionableState, ISerializationCallbackReceiver
Constructors
PartitionedState()
Default constructor.
Declaration
public PartitionedState()
PartitionedState(PartitionedState)
Copy constructor.
Declaration
public PartitionedState(PartitionedState partitionedState)
Parameters
Type | Name | Description |
---|---|---|
Partitioned |
partitionedState | The partitioned state to copy. |
Methods
Get<TSliceState>(string)
Implementation of the method to get the slice state from the store state.
Declaration
public TSliceState Get<TSliceState>(string sliceName)
Parameters
Type | Name | Description |
---|---|---|
string | sliceName | The name of the slice. |
Returns
Type | Description |
---|---|
TSlice |
The slice state. |
Type Parameters
Name | Description |
---|---|
TSliceState | The type of the slice state. |
OnAfterDeserialize()
Implement this method to receive a callback after Unity deserializes your object.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this method to receive a callback before Unity serializes your object.
Declaration
public void OnBeforeSerialize()
Set<TSliceState>(string, TSliceState)
Implementation of the method to set the slice state in the store state.
Declaration
public PartitionedState Set<TSliceState>(string sliceName, TSliceState sliceState)
Parameters
Type | Name | Description |
---|---|---|
string | sliceName | The name of the slice. |
TSlice |
sliceState | c The slice state. |
Returns
Type | Description |
---|---|
Partitioned |
The new store state. |
Type Parameters
Name | Description |
---|---|
TSliceState | The type of the slice state. |
Remarks
It is important to note that this method should return a new instance of the store state to ensure immutability.