Constructs a new CovidActNowDataProvider instance.
A unique provider id to associate with the provider (e.g. "can-api"). This ID can be used from a MetricDataReference in a metric to reference the data from this provider.
Valid Covid Act Now API key to use in API calls.
Optional
data: { JSON data to put directly into the cache. Used primarily for testing.
Private
apiCached CAN API responses indexed by the FIPS codes of the regions fetched.
Private
Readonly
apiValid Covid Act Now API key to use in API calls.
Readonly
idA unique provider id to associate with the provider (e.g. "can-api"). This ID can be used from a MetricDataReference in a metric to reference the data from this provider.
Construct a Covid Act Now API url for a given region.
Covid Act Now API url for the given region and timeseries specification.
Region to create url for
Whether to include timeseries data in API url.
Fetches all of the data for the specified regions and metrics, optionally including timeseries metric data if available.
The fetched data for the specified regions and metrics.
Private
getPrivate helper method to retrieve data from cache.
Always returns timeseries data if it exists, otherwise, if includeTimeseries is false, return non-timeseries data if it exists.
Data from cache, or undefined if no data found.
Region to retrieve data for
Whether timeseries data is necessary.
Private
getPrivate
populateChecks if we have cached data for the specified regions already, else initiates requests to fetch them. Note that we do not wait on them to finish. We just asynchronously start the requests and cache the promises.
Regions to ensure are cached.
Whether timeseries data is required.
Generated using TypeDoc
Data provider to ingest data from the Covid Act Now API.
Access nested JSON API data using dot notation. E.g.:
newCases
data, set metric.dataReference.column toactuals.newCases
.actuals.hospitalBeds.capacity
.communityLevels.canCommunityLevel
.