qortex-core 0.1.7 → 0.1.9
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.
- package/index.d.ts +9 -35
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -182,41 +182,15 @@ declare class QueryManagerCore {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
declare const _queryManager: QueryManagerCore;
|
|
185
|
-
declare const registerFetcher:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
declare const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
fetcher: F;
|
|
195
|
-
}): Promise<InferFetcherResult<F>>;
|
|
196
|
-
};
|
|
197
|
-
declare const setQueryData: <T = any>(key: QueryKey, data: T) => void;
|
|
198
|
-
declare const getQueryData: {
|
|
199
|
-
<T = any>(key: QueryKey, opts?: QueryOptions<T>): T | undefined;
|
|
200
|
-
<F extends Fetcher>(key: QueryKey, opts: QueryOptions<InferFetcherResult<F>> & {
|
|
201
|
-
fetcher: F;
|
|
202
|
-
}): InferFetcherResult<F> | undefined;
|
|
203
|
-
};
|
|
204
|
-
declare const getQueryState: {
|
|
205
|
-
<T = unknown>(key: QueryKey, opts?: QueryOptions<T>): QueryState<T>;
|
|
206
|
-
<F extends Fetcher>(key: QueryKey, opts: QueryOptions<InferFetcherResult<F>> & {
|
|
207
|
-
fetcher: F;
|
|
208
|
-
}): QueryState<InferFetcherResult<F>>;
|
|
209
|
-
};
|
|
210
|
-
declare const invalidateQuery: (key: QueryKey) => void;
|
|
211
|
-
declare const subscribeQuery: {
|
|
212
|
-
(key: QueryKey, cb: (state: QueryState<any>) => void): () => void;
|
|
213
|
-
<F extends Fetcher>(key: QueryKey, cb: (state: QueryState<InferFetcherResult<F>>) => void, opts: QueryOptions<InferFetcherResult<F>> & {
|
|
214
|
-
fetcher: F;
|
|
215
|
-
}): () => void;
|
|
216
|
-
<T = any>(key: QueryKey, cb: (state: QueryState<T>) => void, opts?: QueryOptions<T>): () => void;
|
|
217
|
-
};
|
|
218
|
-
declare const setDefaultConfig: ({ throttleTime, ...config }: DefaultConfig) => void;
|
|
219
|
-
declare const dangerClearCache: () => void;
|
|
185
|
+
declare const registerFetcher: QueryManagerCore["registerFetcher"];
|
|
186
|
+
declare const fetchQuery: QueryManagerCore["fetchQuery"];
|
|
187
|
+
declare const setQueryData: QueryManagerCore["setQueryData"];
|
|
188
|
+
declare const getQueryData: QueryManagerCore["getQueryData"];
|
|
189
|
+
declare const getQueryState: QueryManagerCore["getQueryState"];
|
|
190
|
+
declare const invalidateQuery: QueryManagerCore["invalidateQuery"];
|
|
191
|
+
declare const subscribeQuery: QueryManagerCore["subscribeQuery"];
|
|
192
|
+
declare const setDefaultConfig: QueryManagerCore["setDefaultConfig"];
|
|
193
|
+
declare const dangerClearCache: QueryManagerCore["dangerClearCache"];
|
|
220
194
|
|
|
221
195
|
/**
|
|
222
196
|
* Normalizes query keys to a consistent string format for internal storage
|
package/index.js
CHANGED
|
@@ -227,7 +227,7 @@ var QueryManagerCore = class {
|
|
|
227
227
|
const promise = Promise.resolve(result);
|
|
228
228
|
state.fetchPromise = promise;
|
|
229
229
|
promise.then((result2) => {
|
|
230
|
-
state.data = result2;
|
|
230
|
+
state.data = state.equalityFn(state.data, result2) ? state.data : result2;
|
|
231
231
|
state.status = "success";
|
|
232
232
|
state.updatedAt = Date.now();
|
|
233
233
|
state.isError = false;
|
package/index.mjs
CHANGED
|
@@ -190,7 +190,7 @@ var QueryManagerCore = class {
|
|
|
190
190
|
const promise = Promise.resolve(result);
|
|
191
191
|
state.fetchPromise = promise;
|
|
192
192
|
promise.then((result2) => {
|
|
193
|
-
state.data = result2;
|
|
193
|
+
state.data = state.equalityFn(state.data, result2) ? state.data : result2;
|
|
194
194
|
state.status = "success";
|
|
195
195
|
state.updatedAt = Date.now();
|
|
196
196
|
state.isError = false;
|