Share via


JSRuntimeExtensions.GetValueAsync<TValue> Method

Definition

Reads the value of the specified JavaScript property asynchronously.

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

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsRuntime
IJSRuntime

The IJSRuntime.

identifier
String

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

timeout
TimeSpan

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

Returns

ValueTask<TValue>

An instance of TValue obtained by JSON-deserializing the return value.

Applies to