Table of Contents

Class BrowserPreferenceMirror

Namespace
The.Web.Preferences
Assembly
Instagile.Web.Client.dll

Mirrors preferences to a browser cookie via JS interop. The synchronous read only works under WASM; in InteractiveServer, cookies are read from the HTTP request by a subclass registered in Instagile.Web.

public class BrowserPreferenceMirror : IPreferenceMirror
Inheritance
BrowserPreferenceMirror
Implements
Inherited Members

Methods

TryRead(IJSRuntime)

The mirrored value, or null when no mirror is available in this environment.

public virtual string? TryRead(IJSRuntime js)

Parameters

js IJSRuntime

Returns

string

WriteAsync(IJSRuntime, string, CancellationToken)

Updates the mirror if one is available in this environment.

public ValueTask WriteAsync(IJSRuntime js, string encoded, CancellationToken cancellationToken)

Parameters

js IJSRuntime
encoded string
cancellationToken CancellationToken

Returns

ValueTask