foxact 0.2.8 → 0.2.9

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.8",
3
+ "version": "0.2.9",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -110,6 +110,24 @@
110
110
  "require": "./use-clipboard/index.cjs",
111
111
  "default": "./use-clipboard/index.js"
112
112
  },
113
+ "./use-debounced-state": {
114
+ "types": "./use-debounced-state/index.d.ts",
115
+ "import": {
116
+ "types": "./use-debounced-state/index.d.ts",
117
+ "default": "./use-debounced-state/index.mjs"
118
+ },
119
+ "require": "./use-debounced-state/index.cjs",
120
+ "default": "./use-debounced-state/index.js"
121
+ },
122
+ "./use-debounced-value": {
123
+ "types": "./use-debounced-value/index.d.ts",
124
+ "import": {
125
+ "types": "./use-debounced-value/index.d.ts",
126
+ "default": "./use-debounced-value/index.mjs"
127
+ },
128
+ "require": "./use-debounced-value/index.cjs",
129
+ "default": "./use-debounced-value/index.js"
130
+ },
113
131
  "./use-error-boundary": {
114
132
  "types": "./use-error-boundary/index.d.ts",
115
133
  "import": {
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":5781,"gzip":3804},"exports":{"context-state":{"raw":369,"gzip":240},"create-context-state":{"raw":146,"gzip":119},"noop":{"raw":32,"gzip":52},"request-idle-callback":{"raw":407,"gzip":229},"typescript-happy-forward-ref":{"raw":118,"gzip":102},"use-array":{"raw":329,"gzip":241},"use-clipboard":{"raw":1071,"gzip":617},"use-error-boundary":{"raw":172,"gzip":157},"use-intersection":{"raw":1214,"gzip":649},"use-isomorphic-layout-effect":{"raw":177,"gzip":143},"use-map":{"raw":348,"gzip":246},"use-retimer":{"raw":197,"gzip":165},"use-set":{"raw":349,"gzip":242},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":327},"use-uncontrolled":{"raw":391,"gzip":275}}}
1
+ {"total":{"raw":6531,"gzip":4335},"exports":{"context-state":{"raw":369,"gzip":240},"create-context-state":{"raw":146,"gzip":119},"noop":{"raw":32,"gzip":52},"request-idle-callback":{"raw":407,"gzip":229},"typescript-happy-forward-ref":{"raw":118,"gzip":102},"use-array":{"raw":329,"gzip":241},"use-clipboard":{"raw":1071,"gzip":617},"use-debounced-state":{"raw":380,"gzip":273},"use-debounced-value":{"raw":370,"gzip":258},"use-error-boundary":{"raw":172,"gzip":157},"use-intersection":{"raw":1214,"gzip":649},"use-isomorphic-layout-effect":{"raw":177,"gzip":143},"use-map":{"raw":348,"gzip":246},"use-retimer":{"raw":197,"gzip":165},"use-set":{"raw":349,"gzip":242},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":327},"use-uncontrolled":{"raw":391,"gzip":275}}}
@@ -0,0 +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]};
@@ -0,0 +1,3 @@
1
+ declare function useDebouncedState<T>(defaultValue: T | (() => T), wait: number, leading?: boolean): readonly [T, (newValue: T) => void];
2
+
3
+ export { useDebouncedState };
@@ -0,0 +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]};
@@ -0,0 +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};
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");exports.useDebouncedValue=function(t,r){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,c]=e.useState(t),i=e.useRef(!0);return e.useEffect(()=>{let e=!1,n=null;return i.current&&u?(i.current=!1,c(t)):n=window.setTimeout(()=>{i.current=!0,c(t)},r),()=>{n&&window.clearTimeout(n)}},[t,u,r]),n};
@@ -0,0 +1,3 @@
1
+ declare function useDebouncedValue<T>(value: T, wait: number, leading?: boolean): T;
2
+
3
+ export { useDebouncedValue };
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");exports.useDebouncedValue=function(t,r){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[n,c]=e.useState(t),i=e.useRef(!0);return e.useEffect(()=>{let e=!1,n=null;return i.current&&u?(i.current=!1,c(t)):n=window.setTimeout(()=>{i.current=!0,c(t)},r),()=>{n&&window.clearTimeout(n)}},[t,u,r]),n};
@@ -0,0 +1 @@
1
+ import"client-only";import{useState as e,useRef as t,useEffect as r}from"react";function n(n,o){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[i,l]=e(n),c=t(!0);return r(()=>{let e=!1,t=null;return c.current&&u?(c.current=!1,l(n)):t=window.setTimeout(()=>{c.current=!0,l(n)},o),()=>{t&&window.clearTimeout(t)}},[n,u,o]),i}export{n as useDebouncedValue};