Class ThunkAPI<TPayload, TThunkArg>
An interface to interact with the thunk during the execution. You can use this interface to abort the thunk, reject the thunk with a value, or fulfill the thunk with a value. You also have access to the store to dispatch new actions.
Inherited Members
Namespace: Unity.AppUI.Redux
Assembly: Unity.AppUI.Redux.dll
Syntax
public class ThunkAPI<TPayload, TThunkArg>
Type Parameters
Name | Description |
---|---|
TPayload | The type of the payload. |
TThunkArg | The type of the argument to pass to the thunk. |
Properties
isCancellationRequested
Whether the thunk has been canceled (ether by the API or by an external cancellation token).
Declaration
public bool isCancellationRequested { get; }
Property Value
Type | Description |
---|---|
bool |
requestId
The request ID of the thunk.
Declaration
public string requestId { get; }
Property Value
Type | Description |
---|---|
string |
store
The store to dispatch new actions or access the state.
Declaration
public Store store { get; }
Property Value
Type | Description |
---|---|
Store |
Methods
Abort(object)
Aborts the thunk.
Declaration
public void Abort(object reason)
Parameters
Type | Name | Description |
---|---|---|
object | reason | The reason for aborting the thunk. It can be null. |
FulFillWithValue(TPayload)
Fulfills the thunk with a value.
Declaration
public void FulFillWithValue(TPayload value)
Parameters
Type | Name | Description |
---|---|---|
TPayload | value | The value to fulfill the thunk with. |
RejectWithValue(TPayload)
Rejects the thunk with a value.
Declaration
public void RejectWithValue(TPayload value)
Parameters
Type | Name | Description |
---|---|---|
TPayload | value | The value to reject the thunk with. |