Skip to Content
Data SourcesReferenceSessionStoragePartSessionStoragePart Class

SessionStoragePart Class

Extends KeyValueSourcePart and allows interaction with a particular key in the browser’s session storage. It provides methods for retrieving, setting, and observing the value associated with the given key

@template T = string | undefined
The type of the value stored in session storage. Defaults to string | undefined

API

class SessionStoragePart<T = string | undefined> extends KeyValueSourcePart<T> { readonly $: Observable<T>; constructor(key: string); get(): T; set(value: T): void; remove(): void; }

Example

import {SessionStoragePart} from '@bitfiber/rx'; const ssPart = new SessionStoragePart('key');
Last updated on