@mezo-org/passport 0.4.0-dev.15 → 0.4.0-dev.16

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,17 +1,17 @@
1
1
  /**
2
- * Hook to update the passport using query invalidation mechanism.
3
- * By calling the update function, the latest data will be refetched as soon as possible.
2
+ * Hook to refresh the passport using query invalidation mechanism.
3
+ * By calling the refresh function, the latest data will be refetched as soon as possible.
4
4
  *
5
5
  * @example
6
- * const { updateCurrentAccount, updateUsdConversion } = useRefreshPassport()
6
+ * const { refreshCurrentAccount, refreshUsdConversion } = useRefreshPassport()
7
7
  *
8
- * // Call this function to update the current account
9
- * const handleUpdateCurrentAccount = async () => {
10
- * await updateCurrentAccount()
8
+ * // Call this function to refresh the current account
9
+ * const handlerefreshCurrentAccount = async () => {
10
+ * await refreshCurrentAccount()
11
11
  * }
12
12
  */
13
13
  export declare function useRefreshPassport(): {
14
- updateCurrentAccount: () => Promise<void>;
15
- updateUsdConversion: () => Promise<void>;
14
+ refreshCurrentAccount: () => Promise<void>;
15
+ refreshUsdConversion: () => Promise<void>;
16
16
  };
17
17
  //# sourceMappingURL=useRefreshPassport.d.ts.map
@@ -2,28 +2,28 @@ import { useQueryClient } from "@tanstack/react-query";
2
2
  import { useCallback } from "react";
3
3
  import { QUERY_KEYS } from "./constants";
4
4
  /**
5
- * Hook to update the passport using query invalidation mechanism.
6
- * By calling the update function, the latest data will be refetched as soon as possible.
5
+ * Hook to refresh the passport using query invalidation mechanism.
6
+ * By calling the refresh function, the latest data will be refetched as soon as possible.
7
7
  *
8
8
  * @example
9
- * const { updateCurrentAccount, updateUsdConversion } = useRefreshPassport()
9
+ * const { refreshCurrentAccount, refreshUsdConversion } = useRefreshPassport()
10
10
  *
11
- * // Call this function to update the current account
12
- * const handleUpdateCurrentAccount = async () => {
13
- * await updateCurrentAccount()
11
+ * // Call this function to refresh the current account
12
+ * const handlerefreshCurrentAccount = async () => {
13
+ * await refreshCurrentAccount()
14
14
  * }
15
15
  */
16
16
  export function useRefreshPassport() {
17
17
  const queryClient = useQueryClient();
18
- const updateCurrentAccount = useCallback(() => queryClient.invalidateQueries({
18
+ const refreshCurrentAccount = useCallback(() => queryClient.invalidateQueries({
19
19
  queryKey: [QUERY_KEYS.ACCOUNT, QUERY_KEYS.CURRENT],
20
20
  }), [queryClient]);
21
- const updateUsdConversion = useCallback(() => queryClient.invalidateQueries({
21
+ const refreshUsdConversion = useCallback(() => queryClient.invalidateQueries({
22
22
  queryKey: [QUERY_KEYS.ASSETS_USD_CONVERSION],
23
23
  }), [queryClient]);
24
24
  return {
25
- updateCurrentAccount,
26
- updateUsdConversion,
25
+ refreshCurrentAccount,
26
+ refreshUsdConversion,
27
27
  };
28
28
  }
29
29
  //# sourceMappingURL=useRefreshPassport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRefreshPassport.js","sourceRoot":"","sources":["../../../src/hooks/useRefreshPassport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,MAAM,oBAAoB,GAAG,WAAW,CACtC,GAAG,EAAE,CACH,WAAW,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;KACnD,CAAC,EACJ,CAAC,WAAW,CAAC,CACd,CAAA;IAED,MAAM,mBAAmB,GAAG,WAAW,CACrC,GAAG,EAAE,CACH,WAAW,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;KAC7C,CAAC,EACJ,CAAC,WAAW,CAAC,CACd,CAAA;IAED,OAAO;QACL,oBAAoB;QACpB,mBAAmB;KACpB,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"useRefreshPassport.js","sourceRoot":"","sources":["../../../src/hooks/useRefreshPassport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,MAAM,qBAAqB,GAAG,WAAW,CACvC,GAAG,EAAE,CACH,WAAW,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;KACnD,CAAC,EACJ,CAAC,WAAW,CAAC,CACd,CAAA;IAED,MAAM,oBAAoB,GAAG,WAAW,CACtC,GAAG,EAAE,CACH,WAAW,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;KAC7C,CAAC,EACJ,CAAC,WAAW,CAAC,CACd,CAAA;IAED,OAAO;QACL,qBAAqB;QACrB,oBAAoB;KACrB,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezo-org/passport",
3
- "version": "0.4.0-dev.15",
3
+ "version": "0.4.0-dev.16",
4
4
  "main": "dist/src/index.js",
5
5
  "license": "GPL-3.0-only",
6
6
  "scripts": {
@@ -3,21 +3,21 @@ import { useCallback } from "react"
3
3
  import { QUERY_KEYS } from "./constants"
4
4
 
5
5
  /**
6
- * Hook to update the passport using query invalidation mechanism.
7
- * By calling the update function, the latest data will be refetched as soon as possible.
6
+ * Hook to refresh the passport using query invalidation mechanism.
7
+ * By calling the refresh function, the latest data will be refetched as soon as possible.
8
8
  *
9
9
  * @example
10
- * const { updateCurrentAccount, updateUsdConversion } = useRefreshPassport()
10
+ * const { refreshCurrentAccount, refreshUsdConversion } = useRefreshPassport()
11
11
  *
12
- * // Call this function to update the current account
13
- * const handleUpdateCurrentAccount = async () => {
14
- * await updateCurrentAccount()
12
+ * // Call this function to refresh the current account
13
+ * const handlerefreshCurrentAccount = async () => {
14
+ * await refreshCurrentAccount()
15
15
  * }
16
16
  */
17
17
  export function useRefreshPassport() {
18
18
  const queryClient = useQueryClient()
19
19
 
20
- const updateCurrentAccount = useCallback(
20
+ const refreshCurrentAccount = useCallback(
21
21
  () =>
22
22
  queryClient.invalidateQueries({
23
23
  queryKey: [QUERY_KEYS.ACCOUNT, QUERY_KEYS.CURRENT],
@@ -25,7 +25,7 @@ export function useRefreshPassport() {
25
25
  [queryClient],
26
26
  )
27
27
 
28
- const updateUsdConversion = useCallback(
28
+ const refreshUsdConversion = useCallback(
29
29
  () =>
30
30
  queryClient.invalidateQueries({
31
31
  queryKey: [QUERY_KEYS.ASSETS_USD_CONVERSION],
@@ -34,7 +34,7 @@ export function useRefreshPassport() {
34
34
  )
35
35
 
36
36
  return {
37
- updateCurrentAccount,
38
- updateUsdConversion,
37
+ refreshCurrentAccount,
38
+ refreshUsdConversion,
39
39
  }
40
40
  }