JSRuntimeExtensions.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(IJSRuntime, String, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSRuntime, String, CancellationToken, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSRuntime, String, TimeSpan, Object[]) |
Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the |
InvokeNewAsync(IJSRuntime, String, Object[])
- Source:
- JSRuntimeExtensions.cs
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.IJSRuntime jsRuntime, string identifier, params object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSRuntime * string * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsRuntime As IJSRuntime, identifier As String, ParamArray args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsRuntime
- IJSRuntime
The IJSRuntime.
- 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(IJSRuntime, String, CancellationToken, Object[])
- Source:
- JSRuntimeExtensions.cs
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.IJSRuntime jsRuntime, string identifier, System.Threading.CancellationToken cancellationToken, object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSRuntime * string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsRuntime As IJSRuntime, identifier As String, cancellationToken As CancellationToken, args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsRuntime
- IJSRuntime
The IJSRuntime.
- 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
InvokeNewAsync(IJSRuntime, String, TimeSpan, Object[])
- Source:
- JSRuntimeExtensions.cs
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.IJSRuntime jsRuntime, string identifier, TimeSpan timeout, object?[]? args);
static member InvokeNewAsync : Microsoft.JSInterop.IJSRuntime * string * TimeSpan * obj[] -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference>
<Extension()>
Public Function InvokeNewAsync (jsRuntime As IJSRuntime, identifier As String, timeout As TimeSpan, args As Object()) As ValueTask(Of IJSObjectReference)
Parameters
- jsRuntime
- IJSRuntime
The IJSRuntime.
- identifier
- String
An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass"
will invoke the constructor window.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.