@xyo-network/react-module 2.58.0-rc.3 → 2.59.0-rc.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.
- package/dist/cjs/hooks/useRefresh.js +6 -6
- package/dist/cjs/hooks/useRefresh.js.map +1 -1
- package/dist/esm/hooks/useRefresh.js +6 -6
- package/dist/esm/hooks/useRefresh.js.map +1 -1
- package/dist/types/hooks/useRefresh.d.ts +2 -2
- package/dist/types/hooks/useRefresh.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/hooks/useRefresh.tsx +8 -8
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useRefresh = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const useRefresh = () => {
|
|
6
|
-
const [
|
|
6
|
+
const [count, setCount] = (0, react_1.useState)(1);
|
|
7
7
|
return [
|
|
8
|
-
|
|
8
|
+
count,
|
|
9
9
|
() => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
return
|
|
10
|
+
const newCount = count + 1;
|
|
11
|
+
setCount(newCount);
|
|
12
|
+
return newCount;
|
|
13
13
|
},
|
|
14
|
-
() =>
|
|
14
|
+
() => setCount(0),
|
|
15
15
|
];
|
|
16
16
|
};
|
|
17
17
|
exports.useRefresh = useRefresh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefresh.js","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":";;;AAAA,iCAAgC;AAKzB,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"useRefresh.js","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":";;;AAAA,iCAAgC;AAKzB,MAAM,UAAU,GAAG,GAA+C,EAAE;IACzE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IACrC,OAAO;QACL,KAAK;QACL,GAAG,EAAE;YACH,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAA;YAC1B,QAAQ,CAAC,QAAQ,CAAC,CAAA;YAClB,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;KAClB,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,UAAU,cAWtB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
export const useRefresh = () => {
|
|
3
|
-
const [
|
|
3
|
+
const [count, setCount] = useState(1);
|
|
4
4
|
return [
|
|
5
|
-
|
|
5
|
+
count,
|
|
6
6
|
() => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
return
|
|
7
|
+
const newCount = count + 1;
|
|
8
|
+
setCount(newCount);
|
|
9
|
+
return newCount;
|
|
10
10
|
},
|
|
11
|
-
() =>
|
|
11
|
+
() => setCount(0),
|
|
12
12
|
];
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=useRefresh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefresh.js","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAKhC,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"useRefresh.js","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAKhC,MAAM,CAAC,MAAM,UAAU,GAAG,GAA+C,EAAE;IACzE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACrC,OAAO;QACL,KAAK;QACL,GAAG,EAAE;YACH,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAA;YAC1B,QAAQ,CAAC,QAAQ,CAAC,CAAA;YAClB,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;KAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type RefreshCallback = () =>
|
|
1
|
+
export type RefreshCallback = () => number;
|
|
2
2
|
export type DisableCallback = () => void;
|
|
3
|
-
export declare const useRefresh: () => [
|
|
3
|
+
export declare const useRefresh: () => [number, RefreshCallback, DisableCallback];
|
|
4
4
|
//# sourceMappingURL=useRefresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefresh.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"useRefresh.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,MAAM,MAAM,CAAA;AAC1C,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAA;AAExC,eAAO,MAAM,UAAU,QAAO,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,CAWtE,CAAA"}
|
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/eth-address": "^2.9.3",
|
|
14
|
-
"@xylabs/react-button": "~2.17.
|
|
15
|
-
"@xylabs/react-crypto": "~2.17.
|
|
16
|
-
"@xylabs/react-flexbox": "~2.17.
|
|
17
|
-
"@xylabs/react-promise": "~2.17.
|
|
18
|
-
"@xyo-network/diviner": "^2.67.0
|
|
19
|
-
"@xyo-network/module": "^2.67.0
|
|
20
|
-
"@xyo-network/react-shared": "~2.
|
|
14
|
+
"@xylabs/react-button": "~2.17.7",
|
|
15
|
+
"@xylabs/react-crypto": "~2.17.7",
|
|
16
|
+
"@xylabs/react-flexbox": "~2.17.7",
|
|
17
|
+
"@xylabs/react-promise": "~2.17.7",
|
|
18
|
+
"@xyo-network/diviner": "^2.67.0",
|
|
19
|
+
"@xyo-network/module": "^2.67.0",
|
|
20
|
+
"@xyo-network/react-shared": "~2.59.0-rc.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@ethersproject/address": "^5.7.0",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"@uniswap/sdk": "^3.0.3",
|
|
30
30
|
"@uniswap/sdk-core": "^3.2.6",
|
|
31
31
|
"@uniswap/v3-sdk": "^3.10.0",
|
|
32
|
-
"@xylabs/react-async-effect": "^2.17.
|
|
32
|
+
"@xylabs/react-async-effect": "^2.17.7",
|
|
33
33
|
"@xylabs/ts-scripts-yarn3": "^2.19.0",
|
|
34
34
|
"@xylabs/tsconfig-react": "^2.19.0",
|
|
35
|
-
"@xyo-network/archivist": "^2.67.0
|
|
36
|
-
"@xyo-network/crypto-asset-plugin": "^2.67.0
|
|
37
|
-
"@xyo-network/diviner-address-history": "^2.67.0
|
|
38
|
-
"@xyo-network/node": "^2.67.0
|
|
35
|
+
"@xyo-network/archivist": "^2.67.0",
|
|
36
|
+
"@xyo-network/crypto-asset-plugin": "^2.67.0",
|
|
37
|
+
"@xyo-network/diviner-address-history": "^2.67.0",
|
|
38
|
+
"@xyo-network/node": "^2.67.0",
|
|
39
39
|
"typescript": "^5.1.6"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
},
|
|
91
91
|
"sideEffects": false,
|
|
92
92
|
"types": "dist/types/index.d.ts",
|
|
93
|
-
"version": "2.
|
|
94
|
-
"stableVersion": "2.
|
|
93
|
+
"version": "2.59.0-rc.1",
|
|
94
|
+
"stableVersion": "2.58.0"
|
|
95
95
|
}
|
package/src/hooks/useRefresh.tsx
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
|
|
3
|
-
export type RefreshCallback = () =>
|
|
3
|
+
export type RefreshCallback = () => number
|
|
4
4
|
export type DisableCallback = () => void
|
|
5
5
|
|
|
6
|
-
export const useRefresh = (): [
|
|
7
|
-
const [
|
|
6
|
+
export const useRefresh = (): [number, RefreshCallback, DisableCallback] => {
|
|
7
|
+
const [count, setCount] = useState(1)
|
|
8
8
|
return [
|
|
9
|
-
|
|
9
|
+
count,
|
|
10
10
|
() => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
return
|
|
11
|
+
const newCount = count + 1
|
|
12
|
+
setCount(newCount)
|
|
13
|
+
return newCount
|
|
14
14
|
},
|
|
15
|
-
() =>
|
|
15
|
+
() => setCount(0),
|
|
16
16
|
]
|
|
17
17
|
}
|