Share via


IJSObjectReference.InvokeAsync Method

Definition

Overloads

InvokeAsync<TValue>(String, Object[])

Invokes the specified JavaScript function asynchronously.

JSRuntime will apply timeouts to this operation based on the value configured in DefaultAsyncTimeout. To dispatch a call with a different, or no timeout, consider using InvokeAsync<TValue>(String, CancellationToken, Object[]).

InvokeAsync<TValue>(String, CancellationToken, Object[])

Invokes the specified JavaScript function asynchronously.

InvokeAsync<TValue>(String, Object[])

Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs

Invokes the specified JavaScript function asynchronously.

JSRuntime will apply timeouts to this operation based on the value configured in DefaultAsyncTimeout. To dispatch a call with a different, or no timeout, consider using InvokeAsync<TValue>(String, CancellationToken, Object[]).

public:
generic <typename TValue>
 System::Threading::Tasks::ValueTask<TValue> InvokeAsync(System::String ^ identifier, cli::array <System::Object ^> ^ args);
public System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (string identifier, object?[]? args);
abstract member InvokeAsync : string * obj[] -> System.Threading.Tasks.ValueTask<'Value>
Public Function InvokeAsync(Of TValue) (identifier As String, args As Object()) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

identifier
String

An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function someScope.someFunction on the target instance.

args
Object[]

JSON-serializable arguments.

Returns

ValueTask<TValue>

An instance of TValue obtained by JSON-deserializing the return value.

Applies to

InvokeAsync<TValue>(String, CancellationToken, Object[])

Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs
Source:
IJSObjectReference.cs

Invokes the specified JavaScript function asynchronously.

public:
generic <typename TValue>
 System::Threading::Tasks::ValueTask<TValue> InvokeAsync(System::String ^ identifier, System::Threading::CancellationToken cancellationToken, cli::array <System::Object ^> ^ args);
public System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (string identifier, System.Threading.CancellationToken cancellationToken, object?[]? args);
abstract member InvokeAsync : string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<'Value>
Public Function InvokeAsync(Of TValue) (identifier As String, cancellationToken As CancellationToken, args As Object()) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

identifier
String

An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function someScope.someFunction on the target instance.

cancellationToken
CancellationToken

A cancellation token to signal the cancellation of the operation. Specifying this parameter will override any default cancellations such as due to timeouts (DefaultAsyncTimeout) from being applied.

args
Object[]

JSON-serializable arguments.

Returns

ValueTask<TValue>

An instance of TValue obtained by JSON-deserializing the return value.

Applies to