JSRuntimeExtensions.InvokeAsync Method

Definition

Overloads

InvokeAsync<TValue>(IJSRuntime, 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<TValue>(String, CancellationToken, Object[]).

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

Invokes the specified JavaScript function asynchronously.

InvokeAsync<TValue>(IJSRuntime, String, TimeSpan, Object[])

Invokes the specified JavaScript function asynchronously.

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

Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.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<TValue>(String, CancellationToken, Object[]).

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSRuntime ^ jsRuntime, System::String ^ identifier, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, params object[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSRuntime * string * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsRuntime As IJSRuntime, identifier As String, ParamArray args As Object()) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsRuntime
IJSRuntime

The IJSRuntime.

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

ValueTask<TValue>

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

Applies to

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

Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs

Invokes the specified JavaScript function asynchronously.

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSRuntime ^ jsRuntime, System::String ^ identifier, System::Threading::CancellationToken cancellationToken, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, System.Threading.CancellationToken cancellationToken, params object[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, System.Threading.CancellationToken cancellationToken, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSRuntime * string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsRuntime As IJSRuntime, identifier As String, cancellationToken As CancellationToken, ParamArray args As Object()) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsRuntime
IJSRuntime

The IJSRuntime.

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

ValueTask<TValue>

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

Applies to

InvokeAsync<TValue>(IJSRuntime, String, TimeSpan, Object[])

Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs
Source:
JSRuntimeExtensions.cs

Invokes the specified JavaScript function asynchronously.

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSRuntime ^ jsRuntime, System::String ^ identifier, TimeSpan timeout, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, TimeSpan timeout, params object[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, TimeSpan timeout, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSRuntime * string * TimeSpan * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsRuntime As IJSRuntime, identifier As String, timeout As TimeSpan, ParamArray args As Object()) As ValueTask(Of TValue)

Type Parameters

TValue

Parameters

jsRuntime
IJSRuntime

The IJSRuntime.

identifier
String

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

timeout
TimeSpan

The duration after which to cancel the async operation. Overrides default timeouts (DefaultAsyncTimeout).

args
Object[]

JSON-serializable arguments.

Returns

ValueTask<TValue>

A ValueTask that represents the asynchronous invocation operation.

Applies to