Options
All
  • Public
  • Public/Protected
  • All
Menu

Simple Key Value store Defaults to 'auth-client-db' with an object store of 'ic-keyval'

Hierarchy

  • IdbKeyVal

Index

Constructors

  • new IdbKeyVal(_db: Database, _storeName: string): IdbKeyVal

Methods

  • get<T>(key: IDBValidKey): Promise<null | T>
  • Basic getter Pass in a type T for type safety if you know the type the value will have if it is found

    example

    await get('exampleKey') -> 'exampleValue'

    Type Parameters

    • T

    Parameters

    • key: IDBValidKey

      string | number | Date | BufferSource | IDBValidKey[]

    Returns Promise<null | T>

    Promise<T | null>

  • remove(key: IDBValidKey): Promise<void>
  • Remove a key

    Parameters

    • key: IDBValidKey

      {@link IDBValidKey}

    Returns Promise<void>

    void

  • set<T>(key: IDBValidKey, value: T): Promise<IDBValidKey>
  • Basic setter

    Type Parameters

    • T

    Parameters

    • key: IDBValidKey

      string | number | Date | BufferSource | IDBValidKey[]

    • value: T

      value to set

    Returns Promise<IDBValidKey>

    void

Generated using TypeDoc