react-simplikit 0.0.33 → 0.0.35

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.
@@ -14,15 +14,15 @@ type Props<Case> = {
14
14
  * similar to a `switch-case` statement. It is useful when you need to conditionally render different
15
15
  * components depending on a specific state.
16
16
  *
17
- * @param {string | number} value - The value to compare against.
17
+ * @param {Case} value - The value to compare against.
18
18
  * The component associated with the matching key in `caseBy` will be rendered.
19
- * @param {Record<string | number, () => JSX.Element>} caseBy - An object that maps values to
19
+ * @param {Partial<{ [P in StringifiedValue<Case>]: () => ReactElement | null }>} caseBy - An object that maps values to
20
20
  * components to render. The keys represent possible values, and the values are functions returning
21
21
  * the corresponding components.
22
- * @param {() => JSX.Element} [defaultComponent] - The component to render if `value` does not match
22
+ * @param {() => ReactElement | null} [defaultComponent] - The component to render if `value` does not match
23
23
  * any key in `caseBy`.
24
24
  *
25
- * @returns {JSX.Element} A React component that conditionally renders based on cases.
25
+ * @returns {ReactElement | null} A React component that conditionally renders based on cases.
26
26
  *
27
27
  * @example
28
28
  * function App() {
@@ -118,7 +118,6 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
118
118
  if (Date.now() - pendingAt >= throttleMs) {
119
119
  pendingAt = Date.now();
120
120
  debounced.cancel();
121
- debounced(...args);
122
121
  }
123
122
  }
124
123
  debounced(...args);
package/dist/index.cjs CHANGED
@@ -753,7 +753,6 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
753
753
  if (Date.now() - pendingAt >= throttleMs) {
754
754
  pendingAt = Date.now();
755
755
  debounced.cancel();
756
- debounced(...args);
757
756
  }
758
757
  }
759
758
  debounced(...args);
@@ -14,15 +14,15 @@ type Props<Case> = {
14
14
  * similar to a `switch-case` statement. It is useful when you need to conditionally render different
15
15
  * components depending on a specific state.
16
16
  *
17
- * @param {string | number} value - The value to compare against.
17
+ * @param {Case} value - The value to compare against.
18
18
  * The component associated with the matching key in `caseBy` will be rendered.
19
- * @param {Record<string | number, () => JSX.Element>} caseBy - An object that maps values to
19
+ * @param {Partial<{ [P in StringifiedValue<Case>]: () => ReactElement | null }>} caseBy - An object that maps values to
20
20
  * components to render. The keys represent possible values, and the values are functions returning
21
21
  * the corresponding components.
22
- * @param {() => JSX.Element} [defaultComponent] - The component to render if `value` does not match
22
+ * @param {() => ReactElement | null} [defaultComponent] - The component to render if `value` does not match
23
23
  * any key in `caseBy`.
24
24
  *
25
- * @returns {JSX.Element} A React component that conditionally renders based on cases.
25
+ * @returns {ReactElement | null} A React component that conditionally renders based on cases.
26
26
  *
27
27
  * @example
28
28
  * function App() {
@@ -92,7 +92,6 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
92
92
  if (Date.now() - pendingAt >= throttleMs) {
93
93
  pendingAt = Date.now();
94
94
  debounced.cancel();
95
- debounced(...args);
96
95
  }
97
96
  }
98
97
  debounced(...args);
package/esm/index.js CHANGED
@@ -703,7 +703,6 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
703
703
  if (Date.now() - pendingAt >= throttleMs) {
704
704
  pendingAt = Date.now();
705
705
  debounced.cancel();
706
- debounced(...args);
707
706
  }
708
707
  }
709
708
  debounced(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simplikit",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "main": "./dist/index.cjs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -99,8 +99,7 @@
99
99
  "vue": "^3.5.13"
100
100
  },
101
101
  "peerDependencies": {
102
- "react": "*",
103
- "react-dom": "*"
102
+ "react": "*"
104
103
  },
105
104
  "packageManager": "yarn@4.5.3",
106
105
  "module": "./esm/index.js",