PersistentComponentState Class


The state for the components and services of a components application.

public class PersistentComponentState
type PersistentComponentState = class
Public Class PersistentComponentState


PersistAsJson<TValue>(String, TValue)

Serializes instance as JSON and persists it under the given key.


Register a callback to persist the component state when the application is about to be paused. Registered callbacks can use this opportunity to persist their state so that it can be retrieved when the application resumes.

TryTakeFromJson<TValue>(String, TValue)

Tries to retrieve the persisted state as JSON with the given key and deserializes it into an instance of type TValue. When the key is present, the state is successfully returned via instance and removed from the PersistentComponentState.

Applies to