Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface COVID19APIOptions

Hierarchy

  • COVID19APIOptions

Index

Properties

Optional dataValidityInMS

dataValidityInMS: undefined | number

The duration in milliseconds that the data in the data store should be valid for.

After this duration, the data is automatically re-fetched either from GitHub or reloaded from local files, depending on the loadFrom option.

The default is 1 hour.

Optional fetch

fetch: Fetch

The fetch function to use, mainly needed for NodeJS. When this is not provided, it is assumed that there is a fetch function in the global object.

Optional filePaths

filePaths: FilePaths

If "files" is selected for the loadFrom option, you can optionally enter the paths to the CSV files.

If this is omitted, it is assumed that the files are in the same folder, and have the following default names:

  • time_series_covid19_confirmed_global.csv
  • time_series_covid19_deaths_global.csv
  • time_series_covid19_recovered_global.csv
  • time_series_covid19_confirmed_US.csv
  • time_series_covid19_deaths_US.csv

Optional lazyLoadUSData

lazyLoadUSData: undefined | false | true

Whether to only load the US state and county data when it is requested.

The US state and county data is much bigger than the global data, so it usually makes sense to lazy load it for a better user experience.

The default is true.

Optional loadFrom

loadFrom: LoadFromOptions

Where to load the data from. Either the JHU CSSE GitHub repository or from CSV files.

The default is "github".

Optional onLoadingStatusChange

onLoadingStatusChange: undefined | ((isLoading: boolean, loadingMessage?: undefined | string) => void)

Provide a callback function to receive updates on the loading status of an API instance.

Optional store

Where to store the data, and query it from. Either memory or IndexedDB.

The default is "memory".

Generated using TypeDoc