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 |
|---|---|---|
| PartitionedState | 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 |
|---|---|
| TSliceState | The slice state. |
Type Parameters
| Name | Description |
|---|---|
| TSliceState | The type of the slice state. |
OnAfterDeserialize()
Implement this callback to transform data back into runtime data types after an object is deserialized.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this callback to transform data into serializable data types immediately before an object is serialized.
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. |
| TSliceState | sliceState | c The slice state. |
Returns
| Type | Description |
|---|---|
| PartitionedState | 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.