Table of Contents

Class LocalStorageStatePersistence

Namespace
BlazOrbit.Components
Assembly
BlazOrbit.dll

localStorage-backed implementation of IDataCollectionStatePersistence. Goes through the browser's built-in localStorage.getItem / localStorage.setItem via inline JS interop — no module load, no extra TypeScript. Failures (SSR without circuit, runtime disposed, storage quota) are swallowed so a missing browser environment never crashes the grid.

public sealed class LocalStorageStatePersistence : IDataCollectionStatePersistence
Inheritance
object
LocalStorageStatePersistence
Implements

Constructors

LocalStorageStatePersistence(IJSRuntime)

Initializes a new LocalStorageStatePersistence.

public LocalStorageStatePersistence(IJSRuntime js)

Parameters

js IJSRuntime

Methods

LoadAsync(string)

Reads a previously persisted snapshot. Returns null when no payload is stored, the entry is malformed, or the underlying storage is unavailable (e.g. SSR without a JS runtime).

public ValueTask<string?> LoadAsync(string key)

Parameters

key string

Returns

ValueTask<string>

SaveAsync(string, string)

Persists a JSON-shaped payload under key. Implementations swallow transient storage failures so consumers don't need to wrap each call in a try/catch.

public ValueTask SaveAsync(string key, string payload)

Parameters

key string
payload string

Returns

ValueTask