Options
All
  • Public
  • Public/Protected
  • All
Menu

BusStoreAPI is the interface exposed buy EventBus to allow interactions with Stores.

Hierarchy

  • BusStoreApi

Index

Methods

  • createStore<T>(objectType: string, map?: Map<string, T>): BusStore<T>
  • Create a new Store, if the store already exists, then it will be returned, safe for async operations.

    Type parameters

    • T

    Parameters

    • objectType: string

      the string ID of the store you want to create (i.e. 'UserStore')

    • Optional map: Map<string, T>

      pre-populate store with a map of id's to values.

    Returns BusStore<T>

    reference to the BusStore you have just created.

  • destroyStore(objectType: string): boolean
  • Destroy a store (destructive). If called for a galactic store, will trigger closeGalacticStore request to the backend and will destroy the local store copy (store's items on the backend will not be affected).

    Parameters

    • objectType: string

      the string ID of the store you want to destroy (i.e. 'UserStore')

    Returns boolean

  • getStore<T>(objectType: string): BusStore<T>
  • Get a reference to the existing store. If the store does not exist, nothing will be returned.

    Type parameters

    • T

    Parameters

    • objectType: string

      the string ID of the store you want a reference to (i.e. 'UserStore')

    Returns BusStore<T>

  • openGalacticStore<T>(objectType: string, brokerIdentity?: string): BusStore<T>
  • Opens a galactic store.

    Type parameters

    • T

    Parameters

    • objectType: string
    • Optional brokerIdentity: string

      optional broker identity that looks like host:port/endpoint

    Returns BusStore<T>

  • When you need to wait for more than a single store to be ready, readyJoin takes an array of StoreTypes and returns a reference to StoreReadyResult, any function you pass to whenReady will be excuted once all stores have been initialized.

    Parameters

    • caches: string[]

      array of StoreTypes you want to wait for initialization on.

    Returns StoreReadyResult

  • wipeAllStores(): void
  • Wipe out everything, will eradicate all state from all stores by destroying all stores.

    Returns void

Generated using TypeDoc