Share via


IJSRuntime.InvokeNewAsync Method

Definition

Overloads

InvokeNewAsync(String, Object[])

Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator.

InvokeNewAsync(String, CancellationToken, Object[])

Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator.

InvokeNewAsync(String, Object[])

Source:
IJSRuntime.cs

Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator.

public System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference> InvokeNewAsync(string identifier, object?[]? args);
abstract member InvokeNewAsync : string * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
Public Function InvokeNewAsync (identifier As String, args As Object()) As ValueTask(Of IJSObjectReference)

Parameters

identifier
String

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

args
Object[]

JSON-serializable arguments.

Returns

An IJSObjectReference instance that represents the created JS object.

Applies to

InvokeNewAsync(String, CancellationToken, Object[])

Source:
IJSRuntime.cs

Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator.

public System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference> InvokeNewAsync(string identifier, System.Threading.CancellationToken cancellationToken, object?[]? args);
abstract member InvokeNewAsync : string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
Public Function InvokeNewAsync (identifier As String, cancellationToken As CancellationToken, args As Object()) As ValueTask(Of IJSObjectReference)

Parameters

identifier
String

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

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 IJSObjectReference instance that represents the created JS object.

Applies to