Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OStore<E>

Type parameters

  • E

Hierarchy

  • OStore

Index

Constructors

constructor

Properties

S

S: E

Start keys and values passed in via constructor.

entries

entries: Map<any, any> = new Map()

Map of Key Value pair entries containing values store in this store.

Private subjects

subjects: Map<any, ReplaySubject<any>> = new Map()

Map of replay subject id to ReplaySubject instance.

Methods

clear

  • clear(): void

count

  • count(): number
  • Returns the number of key value pairs contained.

    Returns number

    the number of entries in the store.

delete

  • delete(key: any): void
  • Deletes both the value entry and the corresponding {@link ReplaySubject}. Will unsubscribe the {@link ReplaySubject} prior to deleting it, severing communication with corresponding {@link Observable}s.

    Parameters

    • key: any

    Returns void

exists

  • exists(key: any): boolean
  • Check whether a value exists.

    Parameters

    • key: any

    Returns boolean

    True if the entry exists ( Is not null or undefined ) and false otherwise.

isEmpty

  • isEmpty(): boolean
  • Indicates whether the store is empty.

    Returns boolean

    true if the store is empty, false otherwise.

observe

  • observe(key: any): Observable<any>
  • Observe changes to the values.

    Parameters

    • key: any

    Returns Observable<any>

    An {@link Observable} of the value

post

  • post(key: any, value: any): void
  • Set create a key value pair entry and creates a corresponding replay subject instance that will be used to broadcast updates.

    Parameters

    • key: any

      The key identifying the value

    • value: any

      The value

    Returns void

put

  • put(key: any, value: any): void
  • Update a value and notify subscribers.

    Parameters

    • key: any
    • value: any

    Returns void

reset

  • reset(): void
  • Reset the state of the OStore to the values or reset provided in the constructor OStoreStart instance.

    Returns void

snapshot

  • snapshot(key: any): any
  • Retrieve a snapshot of the value.

    Parameters

    • key: any

    Returns any

    A snapshot of the value corresponding to the key.

Generated using TypeDoc