Class ActionCreator<TPayload>
An action creator with a payload.
Inherited Members
Namespace: Unity.AppUI.Redux
Assembly: Unity.AppUI.Redux.dll
Syntax
[Preserve]
public class ActionCreator<TPayload> : IActionCreator<TPayload>, IActionCreator
Type Parameters
| Name | Description |
|---|---|
| TPayload | The type of the payload. |
Constructors
ActionCreator(string)
Creates a new action creator.
Declaration
[Preserve]
public ActionCreator(string type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | The type of the action. |
Properties
type
The type of the action. This is used to determine which reducer to call.
Declaration
public string type { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Invoke(TPayload)
Create the action to dispatch.
Declaration
public Action<TPayload> Invoke(TPayload payload)
Parameters
| Type | Name | Description |
|---|---|---|
| TPayload | payload | The payload of the action. |
Returns
| Type | Description |
|---|---|
| Action<TPayload> | The action to dispatch. |
Match(IAction)
Check if the action matches the action creator.
Declaration
public bool Match(IAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| IAction | action | The action creator. |
Returns
| Type | Description |
|---|---|
| bool | True if the action matches the action creator. |
Operators
implicit operator ActionCreator<TPayload>(string)
Implicitly convert a string to an action creator.
Declaration
public static implicit operator ActionCreator<TPayload>(string type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | The type of the action. |
Returns
| Type | Description |
|---|---|
| ActionCreator<TPayload> | The action creator. |