Class AsyncThunkAPIExtensions
Extensions for the async thunk API.
Inherited Members
Namespace: Unity.AppUI.Redux
Assembly: Unity.AppUI.Redux.dll
Syntax
public static class AsyncThunkAPIExtensions
Methods
Dispatch(IThunkAPI, string)
Dispatches an action type to the store.
Declaration
public static void Dispatch(this IThunkAPI api, string actionType)
Parameters
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the thunk API is null. |
Dispatch(IThunkAPI, ActionCreator)
Dispatches an action creator to the store.
Declaration
public static void Dispatch(this IThunkAPI api, ActionCreator creator)
Parameters
Type | Name | Description |
---|---|---|
IThunk |
api | The thunk API. |
Action |
creator | The action creator to dispatch. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the action creator or thunk API is null. |
Dispatch(IThunkAPI, IAction)
Dispatches an action to the store.
Declaration
public static void Dispatch(this IThunkAPI api, IAction action)
Parameters
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the action or thunk API is null. |
Dispatch<TPayload>(IThunkAPI, string, TPayload)
Dispatches an action type to the store.
Declaration
public static void Dispatch<TPayload>(this IThunkAPI api, string actionType, TPayload payload)
Parameters
Type | Name | Description |
---|---|---|
IThunk |
api | The thunk API. |
string | actionType | The action type to dispatch. |
TPayload | payload | The payload to pass to the action creator. |
Type Parameters
Name | Description |
---|---|
TPayload | The type of the payload for the action to dispatch. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the thunk API is null. |
Dispatch<TPayload>(IThunkAPI, ActionCreator<TPayload>, TPayload)
Dispatches an action creator with a payload to the store.
Declaration
public static void Dispatch<TPayload>(this IThunkAPI api, ActionCreator<TPayload> creator, TPayload payload)
Parameters
Type | Name | Description |
---|---|---|
IThunk |
api | The thunk API. |
Action |
creator | The action creator to dispatch. |
TPayload | payload | The payload to pass to the action creator. |
Type Parameters
Name | Description |
---|---|
TPayload | The type of the payload for the action to dispatch. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the action creator or thunk API is null. |
GetState<TState>(IThunkAPI)
Gets the state of the store.
Declaration
public static TState GetState<TState>(this IThunkAPI api)
Parameters
Type | Name | Description |
---|---|---|
IThunk |
api | The thunk API. |
Returns
Type | Description |
---|---|
TState | The state of the store. |
Type Parameters
Name | Description |
---|---|
TState | The type of the store state. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the thunk API is null. |
Invalid |
Thrown if the store does not implement IStore. |