Skip to content

Commit

Permalink
jest
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jun 11, 2024
1 parent c6d33b9 commit f6bf652
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export class HourlyDataCache<T> {
private saveTimeout?: ReturnType<typeof setTimeout>;
private registeredUnload: boolean = false;
private async saveCacheToIndexedDB() {
if (typeof jest !== undefined) {
if (!this.indexedDBCache) {
return;
}
this.indexedDBCache.set(this.indexedDBKey, this.cache, defaultOptions);
return;
}
clearTimeout(this.saveTimeout);
this.saveTimeout = setTimeout(() => {
if (!this.indexedDBCache) {
Expand Down

0 comments on commit f6bf652

Please sign in to comment.