Class StorageServiceInternal

RbStorageService is a service that provides an observable stream of storage change events.

Implements

  • unknown

Constructors

Properties

#changes$: any = ...

The Subject receiving the storage change events.

#destroy$: any = ...
#storage: Storage

The browser's local storage object.

#window: Window

The browser's window object.

changes$: any = ...

The observable stream of storage change events, shared among subscribers.

Methods

  • Gets the value of a key in the local storage.

    Parameters

    • key: string

      The key to get the value of

    Returns null | string

    The value of the key or null if it does not exist

  • Removes the value of a key from the local storage and emits a change event.

    Parameters

    • key: string

      The key to remove

    Returns void

  • Sets a key-value pair in the local storage and emits a change event.

    Parameters

    • key: string

      The key to set

    • newValue: string

      The value to set

    Returns void