@aiszlab/relax 1.0.28 → 1.0.30

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description
3
+ * force update
4
+ */
5
+ export declare const useForceUpdate: () => {
6
+ times: number;
7
+ forceUpdate: () => void;
8
+ };
@@ -0,0 +1,18 @@
1
+ import { useState, useCallback } from 'react';
2
+
3
+ /**
4
+ * @description
5
+ * force update
6
+ */
7
+ const useForceUpdate = () => {
8
+ const [times, setTimes] = useState(1);
9
+ const forceUpdate = useCallback(() => {
10
+ setTimes((prev) => prev + 1);
11
+ }, []);
12
+ return {
13
+ times,
14
+ forceUpdate
15
+ };
16
+ };
17
+
18
+ export { useForceUpdate };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { useTimeout } from './hooks/use-timeout';
11
11
  export { useControlledState } from './hooks/use-controlled-state';
12
12
  export { useOnceState } from './hooks/use-once-state';
13
13
  export { useScrollLocker } from './hooks/use-scroll-locker';
14
+ export { useForceUpdate } from './hooks/use-force-update';
14
15
  /**
15
16
  * @description
16
17
  * utils
@@ -21,6 +22,7 @@ export { isStateGetter } from './utils/is-state-getter';
21
22
  export { isNull } from './utils/is-null';
22
23
  export { isVoid } from './utils/is-void';
23
24
  export { isArray } from './utils/is-array';
25
+ export { isComplex } from './utils/is-complex';
24
26
  export { isEmpty } from './utils/is-empty';
25
27
  export { isDomUsable } from './utils/is-dom-usable';
26
28
  export { isMobile } from './utils/is-mobile';
package/dist/index.js CHANGED
@@ -7,12 +7,14 @@ export { useTimeout } from './hooks/use-timeout.js';
7
7
  export { useControlledState } from './hooks/use-controlled-state.js';
8
8
  export { useOnceState } from './hooks/use-once-state.js';
9
9
  export { useScrollLocker } from './hooks/use-scroll-locker.js';
10
+ export { useForceUpdate } from './hooks/use-force-update.js';
10
11
  export { isRefable } from './utils/is-refable.js';
11
12
  export { isUndefined } from './utils/is-undefined.js';
12
13
  export { isStateGetter } from './utils/is-state-getter.js';
13
14
  export { isNull } from './utils/is-null.js';
14
15
  export { isVoid } from './utils/is-void.js';
15
16
  export { isArray } from './utils/is-array.js';
17
+ export { isComplex } from './utils/is-complex.js';
16
18
  export { isEmpty } from './utils/is-empty.js';
17
19
  export { isDomUsable } from './utils/is-dom-usable.js';
18
20
  export { isMobile } from './utils/is-mobile.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description
3
+ * complex
4
+ */
5
+ export declare const isComplex: (value: unknown) => value is Object;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description
3
+ * complex
4
+ */
5
+ const isComplex = (value) => {
6
+ return typeof value === 'object' || typeof value === 'function';
7
+ };
8
+
9
+ export { isComplex };
@@ -1,7 +1,3 @@
1
- import 'react';
2
- import 'rxjs';
3
- import '../hooks/use-scroll-locker.js';
4
- import 'react-is';
5
1
  import { isVoid } from './is-void.js';
6
2
  import { isArray } from './is-array.js';
7
3
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "react utils collection",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",