Data SourcesReferenceMemoryStoragePart

MemoryStoragePart Class

Extends KeyValueSourcePart and allows interacting with the data stored under a specific key in the memory storage. It enables retrieving, setting, observing, and removing data associated with the specified key

@template T = string | undefined
The type of data stored under the specific key. Defaults to string | undefined

API

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

Example

import {MemoryStoragePart} from '@bitfiber/rx';
 
const msPart = new MemoryStoragePart('key');