Options
All
  • Public
  • Public/Protected
  • All
Menu

BaseStore class to manage state in a unified location

Type parameters

  • T: {}

Hierarchy

  • BaseStore

Index

Constructors

Protected constructor

Methods

Protected _dispatch

  • _dispatch(state: Partial<T>): void

destroy

  • destroy(): void
  • Destory the state and call .complete() on the state's underlying observable

    NOTE: once this is called, the store cannot be reused

    Returns void

Protected dispatch

  • dispatch(state: Partial<T>): void
  • Change part of the state to the passed in value.

    This will create a shallow copy of the current state and set all properties of the new passed in state using the spread operator.

    Throws an error if called when the store has already been destroyed (using .destroy()).

    Parameters

    • state: Partial<T>

      partial state to change

    Returns void

getState

getState$

hasDestroyed

  • hasDestroyed(): boolean
  • Check to see if the store has been destroyed. If it has been, it can no longer be used.

    Returns boolean

Generated using TypeDoc