@choksheak/react-utils 0.3.6 → 0.3.8
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/NoSSR.cjs +37 -0
- package/NoSSR.d.mts +24 -0
- package/NoSSR.d.ts +20 -0
- package/NoSSR.min.cjs +2 -0
- package/NoSSR.min.cjs.map +1 -0
- package/NoSSR.min.mjs +2 -0
- package/NoSSR.min.mjs.map +1 -0
- package/NoSSR.mjs +12 -0
- package/README.md +10 -1
- package/fetcher.cjs +3 -3
- package/fetcher.d.mts +5 -4
- package/fetcher.d.ts +4 -3
- package/fetcher.min.cjs +1 -1
- package/fetcher.min.cjs.map +1 -1
- package/fetcher.min.mjs +1 -1
- package/fetcher.min.mjs.map +1 -1
- package/fetcher.mjs +2 -2
- package/package.json +21 -3
- package/sharedQuery.cjs +486 -486
- package/sharedQuery.d.mts +64 -61
- package/sharedQuery.d.ts +62 -59
- package/sharedQuery.min.cjs +1 -1
- package/sharedQuery.min.cjs.map +1 -1
- package/sharedQuery.min.mjs +1 -1
- package/sharedQuery.min.mjs.map +1 -1
- package/sharedQuery.mjs +487 -486
- package/sharedState.cjs +201 -199
- package/sharedState.d.mts +48 -38
- package/sharedState.d.ts +45 -36
- package/sharedState.min.cjs +1 -1
- package/sharedState.min.cjs.map +1 -1
- package/sharedState.min.mjs +1 -1
- package/sharedState.min.mjs.map +1 -1
- package/sharedState.mjs +202 -199
- package/storage.cjs +79 -65
- package/storage.d.mts +39 -2
- package/storage.d.ts +37 -1
- package/storage.min.cjs +1 -1
- package/storage.min.cjs.map +1 -1
- package/storage.min.mjs +1 -1
- package/storage.min.mjs.map +1 -1
- package/storage.mjs +77 -65
- package/stringify.d.mts +9 -0
- package/stringify.d.ts +9 -0
- package/stringify.min.cjs.map +1 -1
- package/stringify.min.mjs.map +1 -1
- package/useDeepMemo.cjs +1 -1
- package/useDeepMemo.d.mts +11 -0
- package/useDeepMemo.d.ts +11 -0
- package/useDeepMemo.min.cjs +1 -1
- package/useDeepMemo.min.cjs.map +1 -1
- package/useDeepMemo.min.mjs +1 -1
- package/useDeepMemo.min.mjs.map +1 -1
- package/useDeepMemo.mjs +1 -1
package/NoSSR.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/NoSSR.tsx
|
|
21
|
+
var NoSSR_exports = {};
|
|
22
|
+
__export(NoSSR_exports, {
|
|
23
|
+
NoSSR: () => NoSSR
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(NoSSR_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var NoSSR = ({ children, fallback }) => {
|
|
28
|
+
const [isClient, setIsClient] = (0, import_react.useState)(false);
|
|
29
|
+
(0, import_react.useEffect)(() => {
|
|
30
|
+
setIsClient(true);
|
|
31
|
+
}, []);
|
|
32
|
+
return isClient ? children : fallback;
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
NoSSR
|
|
37
|
+
});
|
package/NoSSR.d.mts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*
|
|
6
|
+
* Wraps components in <NoSSR>...</NoSSR> to make sure they only render on the
|
|
7
|
+
* client side, and not on the server side.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Props for the NoSSR component. */
|
|
11
|
+
type NoSSRProps = {
|
|
12
|
+
/** The content to render only on the client side. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/** A component to render during SSR or initial load. */
|
|
15
|
+
fallback?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A component that prevents its children from being rendered during
|
|
19
|
+
* Server-Side Rendering (SSR). It renders a optional fallback during SSR, and
|
|
20
|
+
* only renders its children after the component has mounted on the client.
|
|
21
|
+
*/
|
|
22
|
+
declare const NoSSR: React.FC<NoSSRProps>;
|
|
23
|
+
|
|
24
|
+
export { NoSSR, type NoSSRProps };
|
package/NoSSR.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* Wraps components in <NoSSR>...</NoSSR> to make sure they only render on the
|
|
5
|
+
* client side, and not on the server side.
|
|
6
|
+
*/
|
|
7
|
+
import React, { ReactNode } from "react";
|
|
8
|
+
/** Props for the NoSSR component. */
|
|
9
|
+
export type NoSSRProps = {
|
|
10
|
+
/** The content to render only on the client side. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** A component to render during SSR or initial load. */
|
|
13
|
+
fallback?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A component that prevents its children from being rendered during
|
|
17
|
+
* Server-Side Rendering (SSR). It renders a optional fallback during SSR, and
|
|
18
|
+
* only renders its children after the component has mounted on the client.
|
|
19
|
+
*/
|
|
20
|
+
export declare const NoSSR: React.FC<NoSSRProps>;
|
package/NoSSR.min.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of S(e))!l.call(t,c)&&c!==o&&a(t,c,{get:()=>e[c],enumerable:!(r=R(e,c))||r.enumerable});return t};var N=t=>p(a({},"__esModule",{value:!0}),t);var i={};n(i,{NoSSR:()=>f});module.exports=N(i);var s=require("react"),f=({children:t,fallback:e})=>{let[o,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{r(!0)},[]),o?t:e};0&&(module.exports={NoSSR});
|
|
2
|
+
//# sourceMappingURL=NoSSR.min.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/NoSSR.tsx"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * Wraps components in <NoSSR>...</NoSSR> to make sure they only render on the\n * client side, and not on the server side.\n */\n\nimport React, { ReactNode, useEffect, useState } from \"react\";\n\n/** Props for the NoSSR component. */\nexport type NoSSRProps = {\n /** The content to render only on the client side. */\n children: ReactNode;\n\n /** A component to render during SSR or initial load. */\n fallback?: ReactNode;\n};\n\n/**\n * A component that prevents its children from being rendered during\n * Server-Side Rendering (SSR). It renders a optional fallback during SSR, and\n * only renders its children after the component has mounted on the client.\n */\nexport const NoSSR: React.FC<NoSSRProps> = ({ children, fallback }) => {\n const [isClient, setIsClient] = useState(false);\n\n // 2. useEffect runs ONLY on the client after the initial hydration is complete.\n useEffect(() => {\n // This forces the component to render a second time.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsClient(true);\n }, []);\n\n return isClient ? children : fallback;\n};\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAOA,IAAAI,EAAsD,iBAgBzCF,EAA8B,CAAC,CAAE,SAAAG,EAAU,SAAAC,CAAS,IAAM,CACrE,GAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EAG9C,sBAAU,IAAM,CAGdA,EAAY,EAAI,CAClB,EAAG,CAAC,CAAC,EAEED,EAAWF,EAAWC,CAC/B","names":["NoSSR_exports","__export","NoSSR","__toCommonJS","import_react","children","fallback","isClient","setIsClient"]}
|
package/NoSSR.min.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/NoSSR.tsx"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * Wraps components in <NoSSR>...</NoSSR> to make sure they only render on the\n * client side, and not on the server side.\n */\n\nimport React, { ReactNode, useEffect, useState } from \"react\";\n\n/** Props for the NoSSR component. */\nexport type NoSSRProps = {\n /** The content to render only on the client side. */\n children: ReactNode;\n\n /** A component to render during SSR or initial load. */\n fallback?: ReactNode;\n};\n\n/**\n * A component that prevents its children from being rendered during\n * Server-Side Rendering (SSR). It renders a optional fallback during SSR, and\n * only renders its children after the component has mounted on the client.\n */\nexport const NoSSR: React.FC<NoSSRProps> = ({ children, fallback }) => {\n const [isClient, setIsClient] = useState(false);\n\n // 2. useEffect runs ONLY on the client after the initial hydration is complete.\n useEffect(() => {\n // This forces the component to render a second time.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsClient(true);\n }, []);\n\n return isClient ? children : fallback;\n};\n"],"mappings":"AAOA,OAA2B,aAAAA,EAAW,YAAAC,MAAgB,QAgB/C,IAAMC,EAA8B,CAAC,CAAE,SAAAC,EAAU,SAAAC,CAAS,IAAM,CACrE,GAAM,CAACC,EAAUC,CAAW,EAAIL,EAAS,EAAK,EAG9C,OAAAD,EAAU,IAAM,CAGdM,EAAY,EAAI,CAClB,EAAG,CAAC,CAAC,EAEED,EAAWF,EAAWC,CAC/B","names":["useEffect","useState","NoSSR","children","fallback","isClient","setIsClient"]}
|
package/NoSSR.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/NoSSR.tsx
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
var NoSSR = ({ children, fallback }) => {
|
|
4
|
+
const [isClient, setIsClient] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
setIsClient(true);
|
|
7
|
+
}, []);
|
|
8
|
+
return isClient ? children : fallback;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
NoSSR
|
|
12
|
+
};
|
package/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# @choksheak/react-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package is a time-tested collection of React utilities written in
|
|
4
|
+
TypeScript that I have personally needed in almost every project that I have
|
|
5
|
+
worked in. Making this an open source, public npm package allows me to share
|
|
6
|
+
this code freely with others as well as using it for my own personal and
|
|
7
|
+
professional projects. Feel free to use it in your own projects without any
|
|
8
|
+
restrictions.
|
|
9
|
+
|
|
10
|
+
The code supports full tree-shaking. Therefore your code will only grow in size
|
|
11
|
+
by whatever you use. Any code that you are not using will not contribute to your
|
|
12
|
+
code size.
|
|
4
13
|
|
|
5
14
|
Source code: https://github.com/choksheak/react-utils
|
|
6
15
|
|
package/fetcher.cjs
CHANGED
|
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var fetcher_exports = {};
|
|
32
32
|
__export(fetcher_exports, {
|
|
33
33
|
fetcher: () => fetcher,
|
|
34
|
-
|
|
34
|
+
fetcherNoRetries: () => fetcherNoRetries
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(fetcher_exports);
|
|
37
37
|
var import_wretch = __toESM(require("wretch"));
|
|
@@ -43,9 +43,9 @@ var fetcher = (0, import_wretch.default)().middlewares([
|
|
|
43
43
|
retryOnNetworkError: true
|
|
44
44
|
})
|
|
45
45
|
]);
|
|
46
|
-
var
|
|
46
|
+
var fetcherNoRetries = (0, import_wretch.default)();
|
|
47
47
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
48
|
0 && (module.exports = {
|
|
49
49
|
fetcher,
|
|
50
|
-
|
|
50
|
+
fetcherNoRetries
|
|
51
51
|
});
|
package/fetcher.d.mts
CHANGED
|
@@ -27,9 +27,10 @@ import * as wretch from 'wretch';
|
|
|
27
27
|
*/
|
|
28
28
|
declare const fetcher: wretch.Wretch<unknown, unknown, undefined, undefined>;
|
|
29
29
|
/**
|
|
30
|
-
* Name this as `
|
|
31
|
-
* Use this if you don't want retries. Use `fetcher` if you want
|
|
30
|
+
* Name this as `fetcherNoRetries` to make it easier to understand than
|
|
31
|
+
* `wretch`. Use this if you don't want retries. Use `fetcher` if you want
|
|
32
|
+
* retries.
|
|
32
33
|
*/
|
|
33
|
-
declare const
|
|
34
|
+
declare const fetcherNoRetries: wretch.Wretch<unknown, unknown, undefined, undefined>;
|
|
34
35
|
|
|
35
|
-
export { fetcher,
|
|
36
|
+
export { fetcher, fetcherNoRetries };
|
package/fetcher.d.ts
CHANGED
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const fetcher: import("wretch").Wretch<unknown, unknown, undefined, undefined>;
|
|
27
27
|
/**
|
|
28
|
-
* Name this as `
|
|
29
|
-
* Use this if you don't want retries. Use `fetcher` if you want
|
|
28
|
+
* Name this as `fetcherNoRetries` to make it easier to understand than
|
|
29
|
+
* `wretch`. Use this if you don't want retries. Use `fetcher` if you want
|
|
30
|
+
* retries.
|
|
30
31
|
*/
|
|
31
|
-
export declare const
|
|
32
|
+
export declare const fetcherNoRetries: import("wretch").Wretch<unknown, unknown, undefined, undefined>;
|
package/fetcher.min.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.create;var m=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty;var w=(r,e)=>{for(var t in e)m(r,t,{get:e[t],enumerable:!0})},p=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!n.call(r,o)&&o!==t&&m(r,o,{get:()=>e[o],enumerable:!(i=a(e,o))||i.enumerable});return r};var x=(r,e,t)=>(t=r!=null?f(h(r)):{},p(e||!r||!r.__esModule?m(t,"default",{value:r,enumerable:!0}):t,r)),y=r=>p(m({},"__esModule",{value:!0}),r);var k={};w(k,{fetcher:()=>l,fetcherNoRetries:()=>N});module.exports=y(k);var c=x(require("wretch")),s=require("wretch/middlewares"),l=(0,c.default)().middlewares([(0,s.retry)({maxAttempts:3,delayTimer:1e3,retryOnNetworkError:!0})]),N=(0,c.default)();0&&(module.exports={fetcher,fetcherNoRetries});
|
|
2
2
|
//# sourceMappingURL=fetcher.min.cjs.map
|
package/fetcher.min.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/fetcher.ts"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * An alternate syntax to fetch() that allows function chaining to compose the\n * entire fetch request. One can also compose partial fetcher objects to be\n * reused in future requests.\n *\n * Examples:\n * ```\n * const userFetcher = fetcher\n * .auth(\"Bearer TOPSECRET\")\n * .content(\"application/json\")\n * .url(\"/api/user\");\n *\n * const user = await userFetcher.get();\n *\n * const updateResult = await userFetcher\n * .body({ id: user.id, name: \"New name\"})\n * .post();\n * ```\n */\n\nimport wretch from \"wretch\";\nimport { retry } from \"wretch/middlewares\";\n\n/**\n * Fetcher with default short retries. Use this to make your queries more\n * robust without any additional work.\n */\nexport const fetcher = wretch().middlewares([\n retry({\n maxAttempts: 3,\n delayTimer: 1000,\n retryOnNetworkError: true,\n }),\n]);\n\n/**\n * Name this as `
|
|
1
|
+
{"version":3,"sources":["../src/fetcher.ts"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * An alternate syntax to fetch() that allows function chaining to compose the\n * entire fetch request. One can also compose partial fetcher objects to be\n * reused in future requests.\n *\n * Examples:\n * ```\n * const userFetcher = fetcher\n * .auth(\"Bearer TOPSECRET\")\n * .content(\"application/json\")\n * .url(\"/api/user\");\n *\n * const user = await userFetcher.get();\n *\n * const updateResult = await userFetcher\n * .body({ id: user.id, name: \"New name\"})\n * .post();\n * ```\n */\n\nimport wretch from \"wretch\";\nimport { retry } from \"wretch/middlewares\";\n\n/**\n * Fetcher with default short retries. Use this to make your queries more\n * robust without any additional work.\n */\nexport const fetcher = wretch().middlewares([\n retry({\n maxAttempts: 3,\n delayTimer: 1000,\n retryOnNetworkError: true,\n }),\n]);\n\n/**\n * Name this as `fetcherNoRetries` to make it easier to understand than\n * `wretch`. Use this if you don't want retries. Use `fetcher` if you want\n * retries.\n */\nexport const fetcherNoRetries = wretch();\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,qBAAAC,IAAA,eAAAC,EAAAJ,GAsBA,IAAAK,EAAmB,qBACnBC,EAAsB,8BAMTJ,KAAU,EAAAK,SAAO,EAAE,YAAY,IAC1C,SAAM,CACJ,YAAa,EACb,WAAY,IACZ,oBAAqB,EACvB,CAAC,CACH,CAAC,EAOYJ,KAAmB,EAAAI,SAAO","names":["fetcher_exports","__export","fetcher","fetcherNoRetries","__toCommonJS","import_wretch","import_middlewares","wretch"]}
|
package/fetcher.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"wretch";import{retry as e}from"wretch/middlewares";var m=r().middlewares([e({maxAttempts:3,delayTimer:1e3,retryOnNetworkError:!0})]),
|
|
1
|
+
import r from"wretch";import{retry as e}from"wretch/middlewares";var m=r().middlewares([e({maxAttempts:3,delayTimer:1e3,retryOnNetworkError:!0})]),c=r();export{m as fetcher,c as fetcherNoRetries};
|
|
2
2
|
//# sourceMappingURL=fetcher.min.mjs.map
|
package/fetcher.min.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/fetcher.ts"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * An alternate syntax to fetch() that allows function chaining to compose the\n * entire fetch request. One can also compose partial fetcher objects to be\n * reused in future requests.\n *\n * Examples:\n * ```\n * const userFetcher = fetcher\n * .auth(\"Bearer TOPSECRET\")\n * .content(\"application/json\")\n * .url(\"/api/user\");\n *\n * const user = await userFetcher.get();\n *\n * const updateResult = await userFetcher\n * .body({ id: user.id, name: \"New name\"})\n * .post();\n * ```\n */\n\nimport wretch from \"wretch\";\nimport { retry } from \"wretch/middlewares\";\n\n/**\n * Fetcher with default short retries. Use this to make your queries more\n * robust without any additional work.\n */\nexport const fetcher = wretch().middlewares([\n retry({\n maxAttempts: 3,\n delayTimer: 1000,\n retryOnNetworkError: true,\n }),\n]);\n\n/**\n * Name this as `
|
|
1
|
+
{"version":3,"sources":["../src/fetcher.ts"],"sourcesContent":["/**\n * @packageDocumentation\n *\n * An alternate syntax to fetch() that allows function chaining to compose the\n * entire fetch request. One can also compose partial fetcher objects to be\n * reused in future requests.\n *\n * Examples:\n * ```\n * const userFetcher = fetcher\n * .auth(\"Bearer TOPSECRET\")\n * .content(\"application/json\")\n * .url(\"/api/user\");\n *\n * const user = await userFetcher.get();\n *\n * const updateResult = await userFetcher\n * .body({ id: user.id, name: \"New name\"})\n * .post();\n * ```\n */\n\nimport wretch from \"wretch\";\nimport { retry } from \"wretch/middlewares\";\n\n/**\n * Fetcher with default short retries. Use this to make your queries more\n * robust without any additional work.\n */\nexport const fetcher = wretch().middlewares([\n retry({\n maxAttempts: 3,\n delayTimer: 1000,\n retryOnNetworkError: true,\n }),\n]);\n\n/**\n * Name this as `fetcherNoRetries` to make it easier to understand than\n * `wretch`. Use this if you don't want retries. Use `fetcher` if you want\n * retries.\n */\nexport const fetcherNoRetries = wretch();\n"],"mappings":"AAsBA,OAAOA,MAAY,SACnB,OAAS,SAAAC,MAAa,qBAMf,IAAMC,EAAUF,EAAO,EAAE,YAAY,CAC1CC,EAAM,CACJ,YAAa,EACb,WAAY,IACZ,oBAAqB,EACvB,CAAC,CACH,CAAC,EAOYE,EAAmBH,EAAO","names":["wretch","retry","fetcher","fetcherNoRetries"]}
|
package/fetcher.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choksheak/react-utils",
|
|
3
3
|
"license": "The Unlicense",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"description": "Miscellaneous React+TypeScript utilities with support for full tree-shaking.",
|
|
6
6
|
"private": false,
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"files": [
|
|
8
9
|
"**/*"
|
|
9
10
|
],
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"ci": "npm run lint && npm run tsc && npm run build && npm run test",
|
|
19
20
|
"ls": "lint-staged",
|
|
20
21
|
"clean": "rm -rf dist",
|
|
21
|
-
"docs": "
|
|
22
|
+
"docs": "typedoc",
|
|
22
23
|
"gen-types": "tsc --emitDeclarationOnly --declaration",
|
|
23
24
|
"gen-exports": "tsx scripts/gen-exports.ts",
|
|
24
25
|
"bump": "tsx scripts/bump-version.ts",
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"type": "commonjs",
|
|
60
61
|
"homepage": "https://github.com/choksheak/react-utils#readme",
|
|
61
62
|
"devDependencies": {
|
|
63
|
+
"@choksheak/ts-utils": "^0.3.5",
|
|
62
64
|
"@eslint/compat": "^1.4.0",
|
|
63
65
|
"@eslint/js": "^9.38.0",
|
|
64
66
|
"@swc/core": "^1.14.0",
|
|
@@ -95,7 +97,7 @@
|
|
|
95
97
|
"wretch": "^3.0.2"
|
|
96
98
|
},
|
|
97
99
|
"peerDependencies": {
|
|
98
|
-
"@choksheak/ts-utils": ">=0.3.
|
|
100
|
+
"@choksheak/ts-utils": ">=0.3.5",
|
|
99
101
|
"lodash": ">=4.17.21",
|
|
100
102
|
"object-sizeof": ">=2.6.5",
|
|
101
103
|
"react": ">=16",
|
|
@@ -104,6 +106,19 @@
|
|
|
104
106
|
},
|
|
105
107
|
"exports": {
|
|
106
108
|
"./package.json": "./package.json",
|
|
109
|
+
"./NoSSR": {
|
|
110
|
+
"types": "./NoSSR.d.ts",
|
|
111
|
+
"import": {
|
|
112
|
+
"production": "./NoSSR.min.mjs",
|
|
113
|
+
"development": "./NoSSR.mjs",
|
|
114
|
+
"default": "./NoSSR.mjs"
|
|
115
|
+
},
|
|
116
|
+
"require": {
|
|
117
|
+
"production": "./NoSSR.min.cjs",
|
|
118
|
+
"development": "./NoSSR.cjs",
|
|
119
|
+
"default": "./NoSSR.cjs"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
107
122
|
"./fetcher": {
|
|
108
123
|
"types": "./fetcher.d.ts",
|
|
109
124
|
"import": {
|
|
@@ -185,6 +200,9 @@
|
|
|
185
200
|
},
|
|
186
201
|
"typesVersions": {
|
|
187
202
|
"*": {
|
|
203
|
+
"NoSSR": [
|
|
204
|
+
"./NoSSR.d.ts"
|
|
205
|
+
],
|
|
188
206
|
"fetcher": [
|
|
189
207
|
"./fetcher.d.ts"
|
|
190
208
|
],
|