Rxova
Skip to content

WebStorageAdapterOptions

optional onError?: (error, operation) => void;

Called when a storage operation fails: blocked storage, corrupt JSON, a full quota. Persistence stays best-effort either way — this is the observability seam (telemetry, a “your changes may not be saved” notice), not a recovery path. Errors thrown by the callback itself are swallowed.

ParameterType
errorunknown
operation"read" | "write" | "remove"

void


optional serializer?: Serializer;

How values become text. Defaults to JSON, which refuses anything it would silently change — a Date, a Map, an undefined — rather than write a value that reads back different.

Pass devalue or superjson to carry those instead. Not bundled: they cost 3.4-3.6 kB brotlied against a whole-library budget of 7.3 kB, and most state is JSON-shaped.