JSObjectReferenceExtensions.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(IJSObjectReference, String, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSObjectReference, String, CancellationToken, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSObjectReference, String, TimeSpan, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSObjectReference, String, Object[])
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new
operator.
public static System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference> InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, params object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSObjectReference * string * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsObjectReference As IJSObjectReference, identifier As String, ParamArray args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsObjectReference
- IJSObjectReference
The IJSObjectReference.
- identifier
- String
An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass"
will invoke the constructor someScope.SomeClass
.
- args
- Object[]
JSON-serializable arguments.
Returns
An IJSObjectReference instance that represents the created JS object.
Applies to
InvokeNewAsync(IJSObjectReference, String, CancellationToken, Object[])
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new
operator.
public static System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference> InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, System.Threading.CancellationToken cancellationToken, object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSObjectReference * string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsObjectReference As IJSObjectReference, identifier As String, cancellationToken As CancellationToken, args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsObjectReference
- IJSObjectReference
The IJSObjectReference.
- identifier
- String
An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass"
will invoke the constructor 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
InvokeNewAsync(IJSObjectReference, String, TimeSpan, Object[])
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new
operator.
public static System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference> InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSObjectReference * string * TimeSpan * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsObjectReference As IJSObjectReference, identifier As String, timeout As TimeSpan, args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsObjectReference
- IJSObjectReference
The IJSObjectReference.
- identifier
- String
An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass"
will invoke the constructor someScope.SomeClass
.
- timeout
- TimeSpan
The duration after which to cancel the async operation. Overrides default timeouts (DefaultAsyncTimeout).
- args
- Object[]
JSON-serializable arguments.
Returns
An IJSObjectReference instance that represents the created JS object.