Share via


IJSRuntime.GetValueAsync Method

Definition

Overloads

GetValueAsync<TValue>(String)

Reads the value of the specified JavaScript property asynchronously.

GetValueAsync<TValue>(String, CancellationToken)

Reads the value of the specified JavaScript property asynchronously.

GetValueAsync<TValue>(String)

Source:
IJSRuntime.cs

Reads the value of the specified JavaScript property asynchronously.

public System.Threading.Tasks.ValueTask<TValue> GetValueAsync<TValue>(string identifier);
abstract member GetValueAsync : string -> System.Threading.Tasks.ValueTask<'Value>
Public Function GetValueAsync(Of TValue) (identifier As String) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

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.

Returns

ValueTask<TValue>

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

Applies to

GetValueAsync<TValue>(String, CancellationToken)

Source:
IJSRuntime.cs

Reads the value of the specified JavaScript property asynchronously.

public System.Threading.Tasks.ValueTask<TValue> GetValueAsync<TValue>(string identifier, System.Threading.CancellationToken cancellationToken);
abstract member GetValueAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Value>
Public Function GetValueAsync(Of TValue) (identifier As String, cancellationToken As CancellationToken) As ValueTask(Of TValue)

Type Parameters

TValue

The JSON-serializable return type.

Parameters

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.

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.

Returns

ValueTask<TValue>

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

Applies to