Options
All
  • Public
  • Public/Protected
  • All
Menu

A data store that saves to and loads from an IndexedDB database.

For more information about its methods see DataStore.

Hierarchy

  • IndexedDBStore

Implements

Index

Properties

Private _db

_db: IDBPDatabase<COVID19TimeSeriesDBSchema> | undefined

Readonly dbName

dbName: "COVID19APIDB" = "COVID19APIDB"

Readonly dbVersion

dbVersion: 1 = 1

Readonly savedAtKey

savedAtKey: "DataSavedAt" = "DataSavedAt"

Readonly sourceLastUpdatedAtKey

sourceLastUpdatedAtKey: "DataSourceLastUpdatedAt" = "DataSourceLastUpdatedAt"

Accessors

Private db

Methods

clearData

  • clearData(): Promise<void>

getCountiesData

  • getCountiesData(countryOrRegion: string, provinceOrState: string): Promise<InternalLocationData[]>

getLocationCount

  • getLocationCount(): Promise<number>

getLocationData

getLocationsList

  • getLocationsList(): Promise<string[]>

getSavedAt

  • getSavedAt(): Promise<Date | undefined>

getSourceLastUpdatedAt

  • getSourceLastUpdatedAt(): Promise<Date | undefined>

getStatesData

init

  • init(): Promise<void>

putLocationData

Private setDB

  • setDB(): Promise<void>
  • Opens an IndexedDB connection.

    If the database is not yet created, it also creates it. If the database exists but is an older version, it upgrades it.

    Returns Promise<void>

setSourceLastUpdatedAt

  • setSourceLastUpdatedAt(lastUpdatedAt: Date): Promise<void>

Generated using TypeDoc