@levrbet/shared 0.1.34 → 0.1.35

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.
@@ -9,6 +9,7 @@ const react_query_1 = require("@tanstack/react-query");
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const ms_1 = __importDefault(require("ms"));
11
11
  const constants_1 = require("../../../core/constants");
12
+ const queryClient_1 = require("../../queryClient");
12
13
  /**
13
14
  * A React Query hook that provides authentication headers for API requests.
14
15
  *
@@ -44,7 +45,7 @@ const useAuthHeaders = (address) => {
44
45
  refetchInterval: (0, ms_1.default)("10m"),
45
46
  staleTime: (0, ms_1.default)("10m"),
46
47
  gcTime: (0, ms_1.default)("10m"),
47
- });
48
+ }, queryClient_1.queryClient);
48
49
  };
49
50
  exports.useAuthHeaders = useAuthHeaders;
50
51
  //# sourceMappingURL=useAuthHeaders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthHeaders.js","sourceRoot":"","sources":["../../../../src/react/hooks/auth/useAuthHeaders.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA0E;AAC1E,uDAAgD;AAChD,oDAAsB;AACtB,4CAAmB;AACnB,uDAA8G;AAE9G;;;;;;;;;;;;;;GAcG;AACI,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC/C,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAA,qBAAQ,GAAE,CAAA;IAC3C,MAAM,aAAa,GAAG,IAAA,6BAAgB,GAAE,CAAA;IACxC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAA;IAEjC,OAAO,IAAA,sBAAQ,EAAC;QACZ,QAAQ,EAAE,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,OAAO,EA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YAChB,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAA;YACpB,MAAM,WAAW,EAAE,CAAA;YAEnB,OAAO;gBACH,CAAC,8BAAkB,CAAC,EAAE,OAAO;gBAC7B,CAAC,qCAAyB,CAAC,EAAE,MAAM,cAAc,EAAE;gBACnD,CAAC,iCAAqB,CAAC,EAAE,aAAa;aACzC,CAAA;QACL,CAAC;QACD,OAAO,EAAE,CAAC,gBAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,eAAe,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;QAC1B,SAAS,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;QACpB,MAAM,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;KACpB,EACD,yBAAW,CACd,CAAA;AACL,CAAC,CAAA;AAzBY,QAAA,cAAc,kBAyB1B"}
@@ -1,2 +1,3 @@
1
1
  export * from "../core";
2
2
  export * from "./hooks";
3
+ export * from "./queryClient";
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("../core"), exports);
18
18
  __exportStar(require("./hooks"), exports);
19
+ __exportStar(require("./queryClient"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,0CAAuB;AACvB,gDAA6B"}
@@ -0,0 +1,9 @@
1
+ import { QueryClient, QueryKey } from "@tanstack/react-query";
2
+ declare module "@tanstack/react-query" {
3
+ interface Register {
4
+ mutationMeta: {
5
+ invalidatesQueries?: QueryKey[];
6
+ };
7
+ }
8
+ }
9
+ export declare const queryClient: QueryClient;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.queryClient = void 0;
4
+ const react_query_1 = require("@tanstack/react-query");
5
+ exports.queryClient = new react_query_1.QueryClient({
6
+ mutationCache: new react_query_1.MutationCache({
7
+ onSuccess: async (_data, _variables, _context, mutation) => {
8
+ for (const queryKey of mutation.meta?.invalidatesQueries ?? [])
9
+ await exports.queryClient.invalidateQueries({ queryKey });
10
+ },
11
+ }),
12
+ });
13
+ //# sourceMappingURL=queryClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryClient.js","sourceRoot":"","sources":["../../src/react/queryClient.ts"],"names":[],"mappings":";;;AAAA,uDAA4E;AAU/D,QAAA,WAAW,GAAG,IAAI,yBAAW,CAAC;IACvC,aAAa,EAAE,IAAI,2BAAa,CAAC;QAC7B,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACvD,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,kBAAkB,IAAI,EAAE;gBAAE,MAAM,mBAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;QACrH,CAAC;KACJ,CAAC;CACL,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {