Dela via


PersistentComponentState Class

Definition

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

public class PersistentComponentState
type PersistentComponentState = class
Public Class PersistentComponentState
Inheritance
PersistentComponentState

Methods

PersistAsJson<TValue>(String, TValue)

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

RegisterOnPersisting(Func<Task>, IComponentRenderMode)

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.

RegisterOnPersisting(Func<Task>)

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