Skip to content

Commit bbdd67f

Browse files
committed
Revert "fixes: #1, converted createCacheStore function to be return singleton store"
This reverts commit 61b8683.
1 parent 5b6b02a commit bbdd67f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ interface CacheNode {
3737
_sie: number;
3838
}
3939

40-
function createCacheNode(maxAge: number, swr: number = 0, sie: number = 0): CacheNode {
40+
function createCacheNode(
41+
maxAge: number,
42+
swr: number = 0,
43+
sie: number = 0
44+
): CacheNode {
4145
const now = Date.now();
4246
return {
4347
s: Status.UNTERMINATED, // status
@@ -70,12 +74,8 @@ export interface Options<V> {
7074

7175
export type PromiseFn<V> = (...args: any[]) => Promise<V>;
7276

73-
let cacheStore: StoreInterface;
7477
function createCacheStore(): StoreInterface {
75-
if (!cacheStore) {
76-
cacheStore = new Store();
77-
}
78-
return cacheStore;
78+
return new Store<any, CacheNode>();
7979
}
8080

8181
/**

0 commit comments

Comments
 (0)