waytale - v0.3.0
    Preparing search index...

    Class IndexedDBStore

    Interface class for simplified, promised-based interaction with in-browser IndexedDB data storage. This class is specialises for using only one data store as key-value backend.

    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • database: IDBDatabase

        API connection to a database

      • storeName: string

        name of the store to use

      Returns IndexedDBStore

    Methods

    • Get the value for a given key from the store.

      Parameters

      • key: string

        name to look up data for

      Returns Promise<any>

      • the looked up value
    • Get multiple values for given keys in a single transaction.

      Parameters

      • keys: string[]

        names to look up data for

      Returns Promise<any[]>

      • the looked up value
    • Set a value for a given key in the store.

      Parameters

      • key: string

        the name to store data as

      • value: any

        the data to store

      Returns Promise<string>

      • key to new or updated storage
    • Set multiple values for given keys in a single transaction. The parameter must contain multiple 2-tuples for calls to set(), i.e. an array of key-value-pairs.

      Parameters

      • pairs: any[][]

        an array of key-value pairs

      Returns Promise<string[]>

      • keys to new or updated storage
    • Create a new connection to a data store for a given database.

      Parameters

      • databaseName: string

        name of the database

      • storeName: string

        name of the store to connect to

      Returns Promise<IndexedDBStore>

      • new database connection