@pdg/react-hook 1.0.25 → 1.0.26

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,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import React from 'react';
3
2
  export declare function clearIntervalRef(ref: React.MutableRefObject<NodeJS.Timeout | undefined>): void;
4
3
  export default clearIntervalRef;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import React from 'react';
3
2
  export declare function clearTimeoutRef(ref: React.MutableRefObject<NodeJS.Timeout | undefined>): void;
4
3
  export default clearTimeoutRef;
package/dist/index.esm.js CHANGED
@@ -7,6 +7,7 @@ import {useRef,useEffect,useState,useCallback,useLayoutEffect}from'react';import
7
7
  else {
8
8
  effect();
9
9
  }
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10
11
  }, deps);
11
12
  }// 구현부
12
13
  function useAutoUpdateState(state, callback) {
@@ -39,6 +40,7 @@ function useAutoUpdateState(state, callback) {
39
40
  else {
40
41
  effect();
41
42
  }
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
44
  }, deps);
43
45
  }// 구현부
44
46
  function useAutoUpdateLayoutState(state, callback) {
@@ -161,12 +163,11 @@ function useAutoUpdateLayoutRefState(state, callback) {
161
163
  useLayoutEffect(function () {
162
164
  console.log('Layout Performance', '-', name, performance.now() - beginTime);
163
165
  });
164
- }function useAutoForceUpdate(name, interval) {
166
+ }function useAutoForceUpdate(interval) {
165
167
  var _a = useState(0), setTick = _a[1];
166
168
  useEffect(function () {
167
169
  var tm = setInterval(function () {
168
170
  setTick(function (old) {
169
- console.log('Auto Force Update', '-', name, old + 1);
170
171
  return old + 1;
171
172
  });
172
173
  }, interval);
@@ -206,7 +207,9 @@ function useAutoUpdateLayoutRefState(state, callback) {
206
207
  else {
207
208
  setValue(function (old) { return old + 1; });
208
209
  }
209
- }, []);
210
+ },
211
+ // eslint-disable-next-line react-hooks/exhaustive-deps
212
+ [delayMilliseconds]);
210
213
  }function clearIntervalRef(ref) {
211
214
  if (ref.current) {
212
215
  clearInterval(ref.current);
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@
7
7
  else {
8
8
  effect();
9
9
  }
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10
11
  }, deps);
11
12
  }// 구현부
12
13
  function useAutoUpdateState(state, callback) {
@@ -39,6 +40,7 @@ function useAutoUpdateState(state, callback) {
39
40
  else {
40
41
  effect();
41
42
  }
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
44
  }, deps);
43
45
  }// 구현부
44
46
  function useAutoUpdateLayoutState(state, callback) {
@@ -161,12 +163,11 @@ function useAutoUpdateLayoutRefState(state, callback) {
161
163
  react.useLayoutEffect(function () {
162
164
  console.log('Layout Performance', '-', name, performance.now() - beginTime);
163
165
  });
164
- }function useAutoForceUpdate(name, interval) {
166
+ }function useAutoForceUpdate(interval) {
165
167
  var _a = react.useState(0), setTick = _a[1];
166
168
  react.useEffect(function () {
167
169
  var tm = setInterval(function () {
168
170
  setTick(function (old) {
169
- console.log('Auto Force Update', '-', name, old + 1);
170
171
  return old + 1;
171
172
  });
172
173
  }, interval);
@@ -206,7 +207,9 @@ function useAutoUpdateLayoutRefState(state, callback) {
206
207
  else {
207
208
  setValue(function (old) { return old + 1; });
208
209
  }
209
- }, []);
210
+ },
211
+ // eslint-disable-next-line react-hooks/exhaustive-deps
212
+ [delayMilliseconds]);
210
213
  }function clearIntervalRef(ref) {
211
214
  if (ref.current) {
212
215
  clearInterval(ref.current);
@@ -1,2 +1,2 @@
1
- export declare function useAutoForceUpdate(name: string, interval: number): void;
1
+ export declare function useAutoForceUpdate(interval: number): void;
2
2
  export default useAutoForceUpdate;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import React from 'react';
3
2
  export type UseIntervalReturnValue = [
4
3
  React.MutableRefObject<NodeJS.Timeout | undefined>,
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import React from 'react';
3
2
  export type UseTimeoutReturnValue = [
4
3
  React.MutableRefObject<NodeJS.Timeout | undefined>,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pdg/react-hook",
3
3
  "title": "React Hook",
4
- "version": "1.0.25",
4
+ "version": "1.0.26",
5
5
  "description": "React Hook",
6
6
  "type": "module",
7
7
  "types": "dist/index.d.ts",
@@ -38,29 +38,30 @@
38
38
  "javascript"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@pdg/util": "^1.0.22",
42
- "@types/react": "^17.0.0 || ^18.0.0",
43
- "react": "^17.0.0 || ^18.0.0"
41
+ "@pdg/util": "^1.0.23",
42
+ "@types/react": ">=17.0.0",
43
+ "react": ">=17.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@rollup/plugin-commonjs": "^25.0.7",
46
+ "@rollup/plugin-commonjs": "^28.0.3",
47
47
  "@rollup/plugin-eslint": "^9.0.5",
48
- "@rollup/plugin-node-resolve": "^15.2.3",
49
- "@typescript-eslint/eslint-plugin": "^7.8.0",
50
- "@typescript-eslint/parser": "^7.8.0",
51
- "eslint": "8.57.0",
52
- "eslint-config-prettier": "^9.1.0",
53
- "eslint-plugin-jsx-a11y": "^6.8.0",
54
- "eslint-plugin-prettier": "^5.1.3",
55
- "eslint-plugin-react": "^7.34.1",
56
- "eslint-plugin-react-hooks": "^4.6.2",
57
- "prettier": "^3.2.5",
58
- "rollup": "^4.17.2",
59
- "rollup-plugin-delete": "^2.0.0",
48
+ "@rollup/plugin-node-resolve": "^16.0.1",
49
+ "@types/node": "^22.14.0",
50
+ "@typescript-eslint/eslint-plugin": "^8.29.1",
51
+ "@typescript-eslint/parser": "^8.29.1",
52
+ "eslint": "8.57.1",
53
+ "eslint-config-prettier": "^10.1.2",
54
+ "eslint-plugin-jsx-a11y": "^6.10.2",
55
+ "eslint-plugin-prettier": "^5.2.6",
56
+ "eslint-plugin-react": "^7.37.5",
57
+ "eslint-plugin-react-hooks": "^5.2.0",
58
+ "prettier": "^3.5.3",
59
+ "rollup": "^4.39.0",
60
+ "rollup-plugin-delete": "^2.2.0",
60
61
  "rollup-plugin-peer-deps-external": "^2.2.4",
61
- "rollup-plugin-postcss": "^4.0.2",
62
+ "rollup-plugin-scss": "^4.0.1",
62
63
  "rollup-plugin-typescript2": "^0.36.0",
63
- "sass": "^1.77.0",
64
- "typescript": "^5.4.5"
64
+ "sass": "^1.86.3",
65
+ "typescript": "^5.8.3"
65
66
  }
66
67
  }