Share via


JSObjectReferenceExtensions.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.IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout);
static member GetValueAsync : Microsoft.JSInterop.IJSObjectReference * string * TimeSpan -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function GetValueAsync(Of TValue) (jsObjectReference As IJSObjectReference, identifier As String, timeout As TimeSpan) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

jsObjectReference
IJSObjectReference

The IJSObjectReference.

identifier
String

An identifier for the property to read. For example, the value "someScope.someProp" will read the value of the property 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