foxact 0.2.14 → 0.2.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -164,6 +164,15 @@
164
164
  "require": "./use-intersection/index.cjs",
165
165
  "default": "./use-intersection/index.js"
166
166
  },
167
+ "./use-is-client": {
168
+ "types": "./use-is-client/index.d.ts",
169
+ "import": {
170
+ "types": "./use-is-client/index.d.ts",
171
+ "default": "./use-is-client/index.mjs"
172
+ },
173
+ "require": "./use-is-client/index.cjs",
174
+ "default": "./use-is-client/index.js"
175
+ },
167
176
  "./use-isomorphic-layout-effect": {
168
177
  "types": "./use-isomorphic-layout-effect/index.d.ts",
169
178
  "import": {
@@ -182,15 +191,6 @@
182
191
  "require": "./use-map/index.cjs",
183
192
  "default": "./use-map/index.js"
184
193
  },
185
- "./use-react-router-enable-concurrent-navigation": {
186
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
187
- "import": {
188
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
189
- "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
190
- },
191
- "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
192
- "default": "./use-react-router-enable-concurrent-navigation/index.js"
193
- },
194
194
  "./use-react-router-is-match": {
195
195
  "types": "./use-react-router-is-match/index.d.ts",
196
196
  "import": {
@@ -200,6 +200,15 @@
200
200
  "require": "./use-react-router-is-match/index.cjs",
201
201
  "default": "./use-react-router-is-match/index.js"
202
202
  },
203
+ "./use-react-router-enable-concurrent-navigation": {
204
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
205
+ "import": {
206
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
207
+ "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
208
+ },
209
+ "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
210
+ "default": "./use-react-router-enable-concurrent-navigation/index.js"
211
+ },
203
212
  "./use-retimer": {
204
213
  "types": "./use-retimer/index.d.ts",
205
214
  "import": {
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":8657,"gzip":5557,"br":0},"exports":{"create-context-state":{"raw":146,"gzip":116,"br":102},"context-state":{"raw":371,"gzip":240,"br":204},"typescript-happy-forward-ref":{"raw":118,"gzip":102,"br":87},"use":{"raw":279,"gzip":175,"br":151},"noop":{"raw":32,"gzip":52,"br":36},"request-idle-callback":{"raw":407,"gzip":231,"br":180},"use-debounced-state":{"raw":380,"gzip":275,"br":231},"use-clipboard":{"raw":1071,"gzip":614,"br":527},"use-array":{"raw":329,"gzip":242,"br":201},"use-error-boundary":{"raw":172,"gzip":157,"br":148},"use-intersection":{"raw":1214,"gzip":652,"br":592},"use-composition-input":{"raw":420,"gzip":262,"br":230},"use-map":{"raw":348,"gzip":243,"br":210},"use-isomorphic-layout-effect":{"raw":177,"gzip":143,"br":120},"use-retimer":{"raw":197,"gzip":165,"br":125},"use-set":{"raw":349,"gzip":242,"br":203},"use-react-router-is-match":{"raw":562,"gzip":369,"br":309},"use-debounced-value":{"raw":370,"gzip":263,"br":214},"use-uncontrolled":{"raw":304,"gzip":236,"br":201},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":325,"br":256},"use-react-router-enable-concurrent-navigation":{"raw":950,"gzip":453,"br":373}}}
1
+ {"total":{"raw":8871,"gzip":5737,"br":0},"exports":{"create-context-state":{"raw":146,"gzip":116,"br":102},"context-state":{"raw":371,"gzip":240,"br":204},"noop":{"raw":32,"gzip":52,"br":36},"typescript-happy-forward-ref":{"raw":118,"gzip":102,"br":87},"use":{"raw":279,"gzip":175,"br":151},"request-idle-callback":{"raw":407,"gzip":231,"br":180},"use-array":{"raw":329,"gzip":242,"br":201},"use-composition-input":{"raw":420,"gzip":262,"br":230},"use-debounced-state":{"raw":380,"gzip":275,"br":231},"use-clipboard":{"raw":1071,"gzip":614,"br":527},"use-debounced-value":{"raw":370,"gzip":263,"br":214},"use-error-boundary":{"raw":238,"gzip":194,"br":158},"use-is-client":{"raw":148,"gzip":143,"br":115},"use-intersection":{"raw":1214,"gzip":652,"br":592},"use-map":{"raw":348,"gzip":243,"br":210},"use-react-router-is-match":{"raw":562,"gzip":369,"br":309},"use-retimer":{"raw":197,"gzip":165,"br":125},"use-isomorphic-layout-effect":{"raw":177,"gzip":143,"br":120},"use-set":{"raw":349,"gzip":242,"br":203},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":325,"br":256},"use-react-router-enable-concurrent-navigation":{"raw":950,"gzip":453,"br":373},"use-uncontrolled":{"raw":304,"gzip":236,"br":201}}}
@@ -1 +1 @@
1
- "use strict";require("client-only");var r=require("react");const e=r=>!1!==r&&null!=r;exports.useErrorBoundary=t=>{let[u,o]=r.useState(!1);if(e(t))throw t;if(e(u))throw u;return o};
1
+ "use strict";require("client-only");var r=require("react");const e=r=>!1!==r&&null!=r;exports.useErrorBoundary=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[n,o]=r.useState(!1);if(e(t))throw t;if(e(n))throw n;return o};
@@ -2,6 +2,6 @@ import * as react from 'react';
2
2
 
3
3
  type ErrorLike = Error | undefined | null | boolean;
4
4
  /** @see https://foxact.skk.moe/use-error-boundary */
5
- declare const useErrorBoundary: (givenError: ErrorLike) => react.Dispatch<react.SetStateAction<ErrorLike>>;
5
+ declare const useErrorBoundary: (givenError?: ErrorLike) => react.Dispatch<react.SetStateAction<ErrorLike>>;
6
6
 
7
7
  export { useErrorBoundary };
@@ -1 +1 @@
1
- "use strict";require("client-only");var r=require("react");const e=r=>!1!==r&&null!=r;exports.useErrorBoundary=t=>{let[u,o]=r.useState(!1);if(e(t))throw t;if(e(u))throw u;return o};
1
+ "use strict";require("client-only");var r=require("react");const e=r=>!1!==r&&null!=r;exports.useErrorBoundary=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[n,o]=r.useState(!1);if(e(t))throw t;if(e(n))throw n;return o};
@@ -1 +1 @@
1
- import"client-only";import{useState as r}from"react";let t=r=>!1!==r&&null!=r,o=o=>{let[e,l]=r(!1);if(t(o))throw o;if(t(e))throw e;return l};export{o as useErrorBoundary};
1
+ import"client-only";import{useState as r}from"react";let t=r=>!1!==r&&null!=r,o=function(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[e,n]=r(!1);if(t(o))throw o;if(t(e))throw e;return n};export{o as useErrorBoundary};
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");exports.useIsClient=()=>{let[t,r]=e.useState(!1);return e.useEffect(()=>{r(!0)},[]),t};
@@ -0,0 +1,4 @@
1
+ /** @see https://foxact.skk.moe/use-is-client */
2
+ declare const useIsClient: () => boolean;
3
+
4
+ export { useIsClient };
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");exports.useIsClient=()=>{let[t,r]=e.useState(!1);return e.useEffect(()=>{r(!0)},[]),t};
@@ -0,0 +1 @@
1
+ import"client-only";import{useState as t,useEffect as e}from"react";let r=()=>{let[r,l]=t(!1);return e(()=>{l(!0)},[]),r};export{r as useIsClient};