@1money/hooks 0.1.0 → 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.
- package/lib/index.js +3 -3
- package/lib/useControlledState/index.js +3 -3
- package/lib/useEventCallback/index.js +3 -3
- package/lib/useLatest/index.js +3 -3
- package/lib/useLayoutEffect/index.js +3 -3
- package/lib/useLayoutState/index.js +3 -3
- package/lib/useMemoizedFn/index.js +3 -3
- package/lib/usePrevious/index.js +3 -3
- package/lib/useSafeState/index.js +5 -5
- package/lib/useSyncState/index.js +3 -3
- package/lib/useUpdateEffect/index.js +3 -3
- package/package.json +31 -17
package/lib/index.js
CHANGED
|
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
useControlledState: () => import_useControlledState.default,
|
|
33
33
|
useEventCallback: () => import_useEventCallback.default,
|
|
34
34
|
useLatest: () => import_useLatest.default,
|
|
@@ -41,7 +41,7 @@ __export(src_exports, {
|
|
|
41
41
|
useTimeoutLock: () => import_useLayoutState.useTimeoutLock,
|
|
42
42
|
useUpdateEffect: () => import_useUpdateEffect.default
|
|
43
43
|
});
|
|
44
|
-
module.exports = __toCommonJS(
|
|
44
|
+
module.exports = __toCommonJS(index_exports);
|
|
45
45
|
var import_useControlledState = __toESM(require("./useControlledState"));
|
|
46
46
|
var import_useEventCallback = __toESM(require("./useEventCallback"));
|
|
47
47
|
var import_useLatest = __toESM(require("./useLatest"));
|
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/useControlledState/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
default: () => useControlledState
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_useLayoutEffect = __toESM(require("../useLayoutEffect"));
|
|
37
37
|
function useControlledState(defaultStateValue, value) {
|
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/useEventCallback/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
default: () => useEventCallback
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_useLatest = __toESM(require("../useLatest"));
|
|
37
37
|
function useEventCallback(fn) {
|
package/lib/useLatest/index.js
CHANGED
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useLatest/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => useLatest
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function useLatest(value) {
|
|
27
27
|
const ref = (0, import_react.useRef)(value);
|
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useLayoutEffect/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => useLayoutEffect
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function useLayoutEffect(effect, deps) {
|
|
27
27
|
const isMounted = (0, import_react.useRef)(false);
|
|
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useLayoutState/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => useLayoutState,
|
|
23
23
|
useTimeoutLock: () => useTimeoutLock
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
function useLayoutState(defaultState) {
|
|
28
28
|
const stateRef = (0, import_react.useRef)(defaultState);
|
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useMemoizedFn/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => useMemoizedFn
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function useMemoizedFn(fn) {
|
|
27
27
|
const fnRef = (0, import_react.useRef)(fn);
|
package/lib/usePrevious/index.js
CHANGED
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/usePrevious/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => usePrevious
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function usePrevious(value) {
|
|
27
27
|
const ref = (0, import_react.useRef)(void 0);
|
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useSafeState/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
default: () =>
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
default: () => index_default
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function useSafeState(initialState) {
|
|
27
27
|
const isMountedRef = (0, import_react.useRef)(true);
|
|
@@ -39,4 +39,4 @@ function useSafeState(initialState) {
|
|
|
39
39
|
}, []);
|
|
40
40
|
return [state, setSafeState];
|
|
41
41
|
}
|
|
42
|
-
var
|
|
42
|
+
var index_default = useSafeState;
|
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/useSyncState/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
default: () => useSyncState
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_useEventCallback = __toESM(require("../useEventCallback"));
|
|
37
37
|
var UNINITIALIZED = Symbol("useSyncState.uninitialized");
|
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/useUpdateEffect/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
default: () => useUpdateEffect
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
function useUpdateEffect(effect, deps) {
|
|
27
27
|
const isMounted = (0, import_react.useRef)(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1money/hooks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React hooks for 1money front-end projects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -89,29 +89,43 @@
|
|
|
89
89
|
},
|
|
90
90
|
"license": "MIT",
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@eslint/js": "^9.
|
|
92
|
+
"@eslint/js": "^9.39.4",
|
|
93
93
|
"@testing-library/react": "^16.3.2",
|
|
94
|
-
"@
|
|
95
|
-
"@types/
|
|
96
|
-
"@types/node": "~18.19.86",
|
|
97
|
-
"@types/react": "~19.1.2",
|
|
94
|
+
"@types/node": "^20.19.0",
|
|
95
|
+
"@types/react": "^19.2.14",
|
|
98
96
|
"@types/react-dom": "^19.2.3",
|
|
99
|
-
"@typescript-eslint/eslint-plugin": "
|
|
100
|
-
"@typescript-eslint/parser": "
|
|
101
|
-
"eslint": "
|
|
102
|
-
"eslint-config-prettier": "
|
|
103
|
-
"eslint-plugin-prettier": "
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
98
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
99
|
+
"eslint": "^9.39.4",
|
|
100
|
+
"eslint-config-prettier": "^10.1.8",
|
|
101
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
104
102
|
"eslint-plugin-react": "~7.37.5",
|
|
105
|
-
"father": "^4.
|
|
103
|
+
"father": "^4.6.17",
|
|
106
104
|
"globals": "^15.15.0",
|
|
107
|
-
"
|
|
108
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
109
|
-
"jsdom": "^29.0.0",
|
|
105
|
+
"jsdom": "^29.0.2",
|
|
110
106
|
"prettier": "~3.5.3",
|
|
111
107
|
"react": "^19.1.0",
|
|
112
108
|
"react-dom": "^19.2.4",
|
|
113
|
-
"ts-jest": "~29.2.6",
|
|
114
109
|
"typescript": "~5.5.4",
|
|
115
|
-
"
|
|
110
|
+
"vite": "^8.0.5",
|
|
111
|
+
"vitest": "^4.1.4"
|
|
112
|
+
},
|
|
113
|
+
"pnpm": {
|
|
114
|
+
"overrides": {
|
|
115
|
+
"@babel/runtime": "7.26.10",
|
|
116
|
+
"@eslint/plugin-kit": "0.3.4",
|
|
117
|
+
"@tootallnate/once": "3.0.1",
|
|
118
|
+
"ajv@6.12.6": "6.14.0",
|
|
119
|
+
"brace-expansion@2.0.2": "2.0.3",
|
|
120
|
+
"esbuild": "0.25.0",
|
|
121
|
+
"flatted": "3.4.2",
|
|
122
|
+
"lodash": "4.18.0",
|
|
123
|
+
"minimatch@3.0.8": "3.1.5",
|
|
124
|
+
"minimatch@3.1.2": "3.1.5",
|
|
125
|
+
"picomatch@2.3.1": "2.3.2",
|
|
126
|
+
"picomatch@4.0.3": "4.0.4",
|
|
127
|
+
"send": "0.19.0",
|
|
128
|
+
"yaml": "1.10.3"
|
|
129
|
+
}
|
|
116
130
|
}
|
|
117
131
|
}
|