Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • State: StateDefining

Hierarchy

  • MutableDB

Index

Constructors

constructor

  • new MutableDB(state: State, options?: { context?: undefined | string; store?: Store<State> }): MutableDB
  • Parameters

    • state: State
    • Default value options: { context?: undefined | string; store?: Store<State> } = {}
      • Optional context?: undefined | string
      • Optional store?: Store<State>

    Returns MutableDB

Properties

Private cachedTables

cachedTables: {}

Type declaration

  • [key: string]: MutableTable<Row>

Private Optional currentContext

currentContext: undefined | string

Private reducer

reducer: (state: State, action: DBAction) => State

Type declaration

    • (state: State, action: DBAction): State
    • Parameters

      Returns State

Private state

state: State

Private Optional store

store: Store<State>

Private subscribers

subscribers: Array<(action: DBAction) => void>

Accessors

snapshot

  • get snapshot(): DB<State>

Methods

commit

  • commit<K>(table?: K, ids?: RowIdentififying): void
  • Type parameters

    • K: RowKeyOf<State>

    Parameters

    • Optional table: K
    • Optional ids: RowIdentififying

    Returns void

context

Private dispatch

get

  • get<K>(name: K): SettingsType<State, K>
  • Type parameters

    • K: SettingsKey<State>

    Parameters

    • name: K

    Returns SettingsType<State, K>

observe

query

  • query<Key>(type: Key): Query<State, Key, RowType<State, Key>>
  • Type parameters

    • Key: RowKeyOf<State>

    Parameters

    • type: Key

    Returns Query<State, Key, RowType<State, Key>>

Private readState

  • readState(state: State): void

reset

  • reset(type?: "all" | "tables" | "settings"): void
  • Parameters

    • Default value type: "all" | "tables" | "settings" = "all"

    Returns void

revert

  • revert<K>(table?: K, ids?: RowIdentififying): void
  • Type parameters

    • K: RowKeyOf<State>

    Parameters

    • Optional table: K
    • Optional ids: RowIdentififying

    Returns void

set

  • set<K, U>(name: K, value: U): void
  • Type parameters

    • K: SettingsKey<State>

    • U: SettingsType<State, K>

    Parameters

    • name: K
    • value: U

    Returns void

subscribe

  • subscribe(callback: (action: DBAction) => void): () => void

table

  • table<K>(type: K): MutableTable<RowType<State, K>>
  • Type parameters

    • K: RowKeyOf<State>

    Parameters

    • type: K

    Returns MutableTable<RowType<State, K>>

transaction

  • transaction(execute: (db: DB<State>, dispatch: DBDispatch) => void): void
  • Parameters

    • execute: (db: DB<State>, dispatch: DBDispatch) => void
        • (db: DB<State>, dispatch: DBDispatch): void
        • Parameters

          • db: DB<State>
          • dispatch: DBDispatch

          Returns void

    Returns void

truncate

  • truncate(): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc