Share via


JSRuntimeExtensions.SetValueAsync<TValue> Method

Definition

Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created.

public static System.Threading.Tasks.ValueTask SetValueAsync<TValue>(this Microsoft.JSInterop.IJSRuntime jsRuntime, string identifier, TValue value, TimeSpan timeout);
static member SetValueAsync : Microsoft.JSInterop.IJSRuntime * string * 'Value * TimeSpan -> System.Threading.Tasks.ValueTask
<Extension()>
Public Function SetValueAsync(Of TValue) (jsRuntime As IJSRuntime, identifier As String, value As TValue, timeout As TimeSpan) As ValueTask

Type Parameters

TValue

JSON-serializable argument type.

Parameters

jsRuntime
IJSRuntime

The IJSRuntime.

identifier
String

An identifier for the property to set. For example, the value "someScope.someProp" will update the property window.someScope.someProp.

value
TValue

JSON-serializable value.

timeout
TimeSpan

The duration after which to cancel the async operation. Overrides default timeouts (DefaultAsyncTimeout).

Returns

A ValueTask that represents the asynchronous invocation operation.

Applies to