mobx-tanstack-query-api 0.0.116 → 0.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builtin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAI1E,eAAO,MAAM,WAAW,qBAmBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAG1E,eAAO,MAAM,WAAW,qBAkBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
package/builtin/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { hashKey } from '@tanstack/query-core';
2
1
  import { EndpointQueryClient } from '../runtime/endpoint-query-client.js';
3
2
  import { HttpClient, isHttpBadResponse } from '../runtime/http-client.js';
4
3
  const MAX_FAILURE_COUNT = 3;
@@ -6,7 +5,6 @@ export const queryClient = new EndpointQueryClient({
6
5
  defaultOptions: {
7
6
  queries: {
8
7
  throwOnError: true,
9
- queryKeyHashFn: hashKey,
10
8
  refetchOnWindowFocus: true,
11
9
  refetchOnReconnect: true,
12
10
  staleTime: 5 * 60 * 1000,
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from '@tanstack/query-core';
1
2
  export * from './runtime/index.js';
2
3
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
package/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from '@tanstack/query-core';
1
2
  export * from './runtime/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-tanstack-query-api",
3
- "version": "0.0.116",
3
+ "version": "0.1.1",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -1,7 +1,8 @@
1
1
  import { InvalidateOptions } from '@tanstack/query-core';
2
- import { QueryClient } from 'mobx-tanstack-query';
2
+ import { QueryClient, QueryClientConfig } from 'mobx-tanstack-query';
3
3
  import { InvalidateEndpointsFilters } from './endpoint-query-client.types.js';
4
4
  export declare class EndpointQueryClient extends QueryClient {
5
+ constructor(config?: QueryClientConfig);
5
6
  invalidateEndpoints({ group, namespace, operationId, tag, predicate, endpoint, ...queryFilters }: InvalidateEndpointsFilters, options?: InvalidateOptions): Promise<void>;
6
7
  }
7
8
  //# sourceMappingURL=endpoint-query-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint-query-client.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint-query-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAG1C,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,mBAAmB,CACjB,EACE,KAAK,EACL,SAAS,EACT,WAAW,EACX,GAAG,EACH,SAAS,EACT,QAAQ,EACR,GAAG,YAAY,EAChB,EAAE,0BAA0B,EAC7B,OAAO,CAAC,EAAE,iBAAiB;CAiE9B"}
1
+ {"version":3,"file":"endpoint-query-client.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint-query-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EAEL,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAG1C,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,MAAM,CAAC,EAAE,iBAAiB;IActC,mBAAmB,CACjB,EACE,KAAK,EACL,SAAS,EACT,WAAW,EACX,GAAG,EACH,SAAS,EACT,QAAQ,EACR,GAAG,YAAY,EAChB,EAAE,0BAA0B,EAC7B,OAAO,CAAC,EAAE,iBAAiB;CAiE9B"}
@@ -1,5 +1,19 @@
1
+ /* eslint-disable @typescript-eslint/no-use-before-define */
2
+ import { hashKey } from '@tanstack/query-core';
1
3
  import { QueryClient } from 'mobx-tanstack-query';
2
4
  export class EndpointQueryClient extends QueryClient {
5
+ constructor(config) {
6
+ super({
7
+ ...config,
8
+ defaultOptions: {
9
+ ...config?.defaultOptions,
10
+ queries: {
11
+ ...config?.defaultOptions?.queries,
12
+ queryKeyHashFn: config?.defaultOptions?.queries?.queryKeyHashFn ?? hashKey,
13
+ },
14
+ },
15
+ });
16
+ }
3
17
  invalidateEndpoints({ group, namespace, operationId, tag, predicate, endpoint, ...queryFilters }, options) {
4
18
  let endpointIdsToFilter;
5
19
  if (Array.isArray(endpoint)) {