foxact 0.2.17 → 0.2.19

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 @@
1
+ "use strict";const r={};exports.createFixedArray=e=>(r[e]||(r[e]=r[e]||Array.from(Array(e).keys())),r[e]);
@@ -0,0 +1,3 @@
1
+ declare const createFixedArray: (length: number) => readonly number[];
2
+
3
+ export { createFixedArray };
@@ -0,0 +1 @@
1
+ "use strict";const r={};exports.createFixedArray=e=>(r[e]||(r[e]=r[e]||Array.from(Array(e).keys())),r[e]);
@@ -0,0 +1 @@
1
+ let r={},e=e=>(r[e]||(r[e]=r[e]||Array.from(Array(e).keys())),r[e]);export{e as createFixedArray};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -65,6 +65,15 @@
65
65
  "require": "./create-context-state/index.cjs",
66
66
  "default": "./create-context-state/index.js"
67
67
  },
68
+ "./create-fixed-array": {
69
+ "types": "./create-fixed-array/index.d.ts",
70
+ "import": {
71
+ "types": "./create-fixed-array/index.d.ts",
72
+ "default": "./create-fixed-array/index.mjs"
73
+ },
74
+ "require": "./create-fixed-array/index.cjs",
75
+ "default": "./create-fixed-array/index.js"
76
+ },
68
77
  "./noop": {
69
78
  "types": "./noop/index.d.ts",
70
79
  "import": {
@@ -245,15 +254,6 @@
245
254
  "require": "./use-singleton/index.cjs",
246
255
  "default": "./use-singleton/index.js"
247
256
  },
248
- "./use-uncontrolled": {
249
- "types": "./use-uncontrolled/index.d.ts",
250
- "import": {
251
- "types": "./use-uncontrolled/index.d.ts",
252
- "default": "./use-uncontrolled/index.mjs"
253
- },
254
- "require": "./use-uncontrolled/index.cjs",
255
- "default": "./use-uncontrolled/index.js"
256
- },
257
257
  "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
258
258
  "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
259
259
  "import": {
@@ -262,6 +262,15 @@
262
262
  },
263
263
  "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
264
264
  "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
265
+ },
266
+ "./use-uncontrolled": {
267
+ "types": "./use-uncontrolled/index.d.ts",
268
+ "import": {
269
+ "types": "./use-uncontrolled/index.d.ts",
270
+ "default": "./use-uncontrolled/index.mjs"
271
+ },
272
+ "require": "./use-uncontrolled/index.cjs",
273
+ "default": "./use-uncontrolled/index.js"
265
274
  }
266
275
  }
267
276
  }
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":9337,"gzip":6112,"br":0},"exports":{"context-state":{"raw":371,"gzip":240,"br":204},"noop":{"raw":32,"gzip":52,"br":36},"request-idle-callback":{"raw":407,"gzip":231,"br":180},"typescript-happy-forward-ref":{"raw":118,"gzip":102,"br":87},"use":{"raw":279,"gzip":175,"br":151},"use-array":{"raw":329,"gzip":242,"br":201},"use-composition-input":{"raw":449,"gzip":280,"br":240},"use-clipboard":{"raw":1071,"gzip":614,"br":527},"use-debounced-value":{"raw":370,"gzip":263,"br":214},"create-context-state":{"raw":146,"gzip":116,"br":102},"use-is-client":{"raw":148,"gzip":143,"br":115},"use-debounced-state":{"raw":380,"gzip":275,"br":231},"use-map":{"raw":348,"gzip":243,"br":210},"use-error-boundary":{"raw":238,"gzip":194,"br":158},"use-next-pathname":{"raw":313,"gzip":236,"br":196},"use-intersection":{"raw":1214,"gzip":652,"br":592},"use-react-router-is-match":{"raw":562,"gzip":369,"br":309},"use-retimer":{"raw":197,"gzip":165,"br":125},"use-set":{"raw":349,"gzip":242,"br":203},"use-singleton":{"raw":135,"gzip":129,"br":111},"use-uncontrolled":{"raw":293,"gzip":228,"br":189},"use-isomorphic-layout-effect":{"raw":177,"gzip":143,"br":120},"use-react-router-enable-concurrent-navigation":{"raw":950,"gzip":453,"br":373},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":325,"br":256}}}
1
+ {"total":{"raw":9461,"gzip":6227,"br":0},"exports":{"create-fixed-array":{"raw":99,"gzip":103,"br":93},"context-state":{"raw":371,"gzip":240,"br":204},"noop":{"raw":32,"gzip":52,"br":36},"create-context-state":{"raw":146,"gzip":116,"br":102},"use":{"raw":279,"gzip":175,"br":151},"use-array":{"raw":329,"gzip":242,"br":201},"typescript-happy-forward-ref":{"raw":118,"gzip":102,"br":87},"use-debounced-state":{"raw":405,"gzip":287,"br":241},"use-clipboard":{"raw":1071,"gzip":614,"br":527},"use-debounced-value":{"raw":370,"gzip":263,"br":214},"use-composition-input":{"raw":449,"gzip":280,"br":240},"use-is-client":{"raw":148,"gzip":143,"br":115},"use-isomorphic-layout-effect":{"raw":177,"gzip":143,"br":120},"request-idle-callback":{"raw":407,"gzip":231,"br":180},"use-map":{"raw":348,"gzip":243,"br":210},"use-next-pathname":{"raw":313,"gzip":236,"br":196},"use-react-router-enable-concurrent-navigation":{"raw":950,"gzip":453,"br":373},"use-react-router-is-match":{"raw":562,"gzip":369,"br":309},"use-set":{"raw":349,"gzip":242,"br":203},"use-retimer":{"raw":197,"gzip":165,"br":125},"use-singleton":{"raw":135,"gzip":129,"br":111},"use-error-boundary":{"raw":238,"gzip":194,"br":158},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":325,"br":256},"use-intersection":{"raw":1214,"gzip":652,"br":592},"use-uncontrolled":{"raw":293,"gzip":228,"br":189}}}
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-retimer/index.cjs");exports.useDebouncedState=function(t,u){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,s]=e.useState(t),c=e.useRef(!0),o=r.useRetimer(),a=e.useCallback(e=>{c.current&&i?s(e):o(window.setTimeout(()=>{c.current=!0,s(e)},u)),c.current=!1},[i,o,u]);return[n,a]};
1
+ "use strict";require("client-only");var e=require("react"),r=require("../use-retimer/index.cjs");exports.useDebouncedState=function(t,u){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,s]=e.useState(t),c=e.useRef(!0),a=r.useRetimer(),l=e.useCallback(e=>{c.current&&i?s(e):a(window.setTimeout(()=>{c.current=!0,s(e)},u)),c.current=!1},[i,a,u]),o=e.useCallback(e=>{a(),s(e)},[a]);return[n,l,o]};
@@ -1,4 +1,4 @@
1
1
  /** @see https://foxact.skk.moe/use-debounced-state */
2
- declare function useDebouncedState<T>(defaultValue: T | (() => T), wait: number, leading?: boolean): readonly [T, (newValue: T) => void];
2
+ declare function useDebouncedState<T>(defaultValue: T | (() => T), wait: number, leading?: boolean): readonly [T, (newValue: T) => void, (newValue: T) => void];
3
3
 
4
4
  export { useDebouncedState };
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-retimer/index.js");exports.useDebouncedState=function(t,u){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,s]=e.useState(t),c=e.useRef(!0),o=r.useRetimer(),a=e.useCallback(e=>{c.current&&i?s(e):o(window.setTimeout(()=>{c.current=!0,s(e)},u)),c.current=!1},[i,o,u]);return[n,a]};
1
+ "use strict";require("client-only");var e=require("react"),r=require("../use-retimer/index.js");exports.useDebouncedState=function(t,u){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,s]=e.useState(t),c=e.useRef(!0),a=r.useRetimer(),l=e.useCallback(e=>{c.current&&i?s(e):a(window.setTimeout(()=>{c.current=!0,s(e)},u)),c.current=!1},[i,a,u]),o=e.useCallback(e=>{a(),s(e)},[a]);return[n,l,o]};
@@ -1 +1 @@
1
- import"client-only";import{useState as e,useRef as t,useCallback as r}from"react";import{useRetimer as n}from"../use-retimer/index.mjs";function o(o,i){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[m,c]=e(o),d=t(!0),l=n(),p=r(e=>{d.current&&u?c(e):l(window.setTimeout(()=>{d.current=!0,c(e)},i)),d.current=!1},[u,l,i]);return[m,p]}export{o as useDebouncedState};
1
+ import"client-only";import{useState as e,useRef as t,useCallback as r}from"react";import{useRetimer as n}from"../use-retimer/index.mjs";function o(o,i){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[m,c]=e(o),d=t(!0),l=n(),p=r(e=>{d.current&&u?c(e):l(window.setTimeout(()=>{d.current=!0,c(e)},i)),d.current=!1},[u,l,i]),s=r(e=>{l(),c(e)},[l]);return[m,p,s]}export{o as useDebouncedState};
@@ -1,4 +1,4 @@
1
1
  /** @see https://foxact.skk.moe/use-retimer */
2
- declare const useRetimer: () => (timerId: number) => void;
2
+ declare const useRetimer: () => (timerId?: number) => void;
3
3
 
4
4
  export { useRetimer };