edges-svelte 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ type StoreDeps = {
|
|
6
6
|
};
|
7
7
|
interface CreateProviderOptions<T, I extends Record<string, unknown> = Record<string, unknown>> {
|
8
8
|
inject?: I;
|
9
|
-
|
9
|
+
cacheKey?: string;
|
10
10
|
factory: (args: StoreDeps & I) => T;
|
11
11
|
}
|
12
12
|
export declare const createProvider: <T, I extends Record<string, unknown> = Record<string, unknown>>(options: CreateProviderOptions<T, I>) => (() => T);
|
@@ -11,11 +11,9 @@ export const createProvider = (options) => {
|
|
11
11
|
},
|
12
12
|
...(options.inject || {})
|
13
13
|
};
|
14
|
-
const cacheKey =
|
15
|
-
const cache = options.cache ?? true;
|
16
|
-
console.log('cache-key', cacheKey);
|
14
|
+
const cacheKey = options.cacheKey;
|
17
15
|
return () => {
|
18
|
-
if (!
|
16
|
+
if (!cacheKey) {
|
19
17
|
return options.factory(deps);
|
20
18
|
}
|
21
19
|
if (browser) {
|