Language

IJSRuntime.InvokeAsync Method

Definition

Overloads

Name Description
InvokeAsync(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 timeout, or no timeout, consider using InvokeAsync(String, CancellationToken, Object[]).

InvokeAsync(String, CancellationToken, Object[])

Invokes the specified JavaScript function asynchronously.

InvokeAsync(String, Object[])

Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.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 timeout, or no timeout, consider using InvokeAsync(String, CancellationToken, Object[]).

public:
generic 
 System::Threading::Tasks::ValueTask InvokeAsync(System::String ^ identifier, cli::array  ^ args);
public System.Threading.Tasks.ValueTask InvokeAsync(string identifier, object?[]? args);
public System.Threading.Tasks.ValueTask InvokeAsync(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 window.someScope.someFunction.

args
Object[]

JSON-serializable arguments.

Returns

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

Applies to

InvokeAsync(String, CancellationToken, Object[])

Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs
Source:
IJSRuntime.cs

Invokes the specified JavaScript function asynchronously.

public:
generic 
 System::Threading::Tasks::ValueTask InvokeAsync(System::String ^ identifier, System::Threading::CancellationToken cancellationToken, cli::array  ^ args);
public System.Threading.Tasks.ValueTask InvokeAsync(string identifier, System.Threading.CancellationToken cancellationToken, object?[]? args);
public System.Threading.Tasks.ValueTask InvokeAsync(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 window.someScope.someFunction.

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

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

Applies to