Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for a simplified subset of the functionality of LDFeatureStore, to be used in conjunction with CachingStoreWrapper.

see

PersistentDataStoreNonAtomic

Hierarchy

Index

Methods

  • close(): void
  • Get all entities from a collection.

    The store should filter out any entities with the property deleted: true.

    Parameters

    • kind: DataKind

      The type of data to be accessed. The store should not make any assumptions about the format of the data, but just return an object in which each key is the key property of an entity and the value is the entity. The actual type of this parameter is [[interfaces.DataKind]].

    • callback: (res: KeyedItems<VersionedData>) => void

      Will be called with the resulting map.

    Returns void

  • Get an entity from the store.

    Parameters

    • kind: DataKind

      The type of data to be accessed. The store should not make any assumptions about the format of the data, but just return a JSON object.

    • key: string

      The unique key of the entity within the specified collection.

    • callback: (res: VersionedData) => void

      Will be called with the retrieved entity, or null if not found.

    Returns void

  • Initialize the store, overwriting any existing data.

    Parameters

    • allData: FullDataSet<VersionedData>

      An object in which each key is the "namespace" of a collection (e.g. "features") and the value is an object that maps keys to entities.

    • callback: () => void

      Will be called when the store has been initialized.

        • (): void
        • Returns void

    Returns void

  • initializedInternal(callback: (isInitialized: boolean) => void): void
  • Tests whether the store is initialized.

    "Initialized" means that the store has been populated with data, either by the client having called init() within this process, or by another process (if this is a shared database).

    Parameters

    • callback: (isInitialized: boolean) => void

      Will be called back with the boolean result.

        • (isInitialized: boolean): void
        • Parameters

          • isInitialized: boolean

          Returns void

    Returns void

  • Add an entity or update an existing entity.

    Parameters

    • kind: DataKind

      The type of data to be accessed.

    • item: VersionedData

      The contents of the entity, as an object that can be converted to JSON. The store should check the version property of this object, and should not overwrite any existing data if the existing version is greater than or equal to that value.

    • callback: (err: Error, finalItem: VersionedData) => void

      Will be called after the upsert operation is complete.

    Returns void

Generated using TypeDoc