JSObjectReference.InvokeNewAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
InvokeNewAsync(String, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(String, CancellationToken, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(String, Object[])
- Source:
- JSObjectReference.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>
override this.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 someScope.SomeClass
on the target instance.
- args
- Object[]
JSON-serializable arguments.
Returns
An IJSObjectReference instance that represents the created JS object.
Implements
Applies to
InvokeNewAsync(String, CancellationToken, Object[])
- Source:
- JSObjectReference.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>
override this.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 someScope.SomeClass
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
An IJSObjectReference instance that represents the created JS object.