JSObjectReferenceExtensions.InvokeAsync Method

Definition

Overloads

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

Invokes the specified JavaScript function asynchronously.

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

Invokes the specified JavaScript function asynchronously.

InvokeAsync<TValue>(IJSObjectReference, 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[]).

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

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsObjectReference
IJSObjectReference

The IJSObjectReference.

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>(IJSObjectReference, String, CancellationToken, Object[])

Invokes the specified JavaScript function asynchronously.

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

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsObjectReference
IJSObjectReference

The IJSObjectReference.

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

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

Invokes the specified JavaScript function asynchronously.

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

Type Parameters

TValue

Parameters

jsObjectReference
IJSObjectReference

The IJSObjectReference.

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.

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