@faasjs/react 3.5.0 → 3.5.2

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/dist/index.d.mts CHANGED
@@ -108,7 +108,7 @@ declare function createSplittingContext<T extends Record<string, any>>(defaultVa
108
108
  * @see https://faasjs.com/doc/react/functions/createSplittingContext.html#provider
109
109
  */
110
110
  Provider<NewT extends T = T>(props: {
111
- value?: Partial<NewT | T>;
111
+ value?: NewT;
112
112
  children: ReactNode;
113
113
  memo?: true | any[];
114
114
  }): ReactNode;
@@ -117,7 +117,7 @@ declare function createSplittingContext<T extends Record<string, any>>(defaultVa
117
117
  *
118
118
  * @see https://faasjs.com/doc/react/functions/createSplittingContext.html#use
119
119
  */
120
- use: <NewT extends T = T>() => Readonly<NewT | T>;
120
+ use: <NewT extends T = T>() => Readonly<NewT>;
121
121
  };
122
122
 
123
123
  /**
package/dist/index.d.ts CHANGED
@@ -108,7 +108,7 @@ declare function createSplittingContext<T extends Record<string, any>>(defaultVa
108
108
  * @see https://faasjs.com/doc/react/functions/createSplittingContext.html#provider
109
109
  */
110
110
  Provider<NewT extends T = T>(props: {
111
- value?: Partial<NewT | T>;
111
+ value?: NewT;
112
112
  children: ReactNode;
113
113
  memo?: true | any[];
114
114
  }): ReactNode;
@@ -117,7 +117,7 @@ declare function createSplittingContext<T extends Record<string, any>>(defaultVa
117
117
  *
118
118
  * @see https://faasjs.com/doc/react/functions/createSplittingContext.html#use
119
119
  */
120
- use: <NewT extends T = T>() => Readonly<NewT | T>;
120
+ use: <NewT extends T = T>() => Readonly<NewT>;
121
121
  };
122
122
 
123
123
  /**
package/dist/index.js CHANGED
@@ -13,6 +13,8 @@ function useConstant(fn) {
13
13
  return ref.current.v;
14
14
  }
15
15
  useConstant.whyDidYouRender = true;
16
+ var AsyncFunction = (async () => {
17
+ }).constructor;
16
18
  function equal(a, b) {
17
19
  if (a === b) return true;
18
20
  if ((a === null || a === void 0) && (b === null || b === void 0))
@@ -37,6 +39,7 @@ function equal(a, b) {
37
39
  return a.getTime() === b.getTime();
38
40
  case RegExp:
39
41
  case Function:
42
+ case AsyncFunction:
40
43
  return a.toString() === b.toString();
41
44
  case Map:
42
45
  case Set:
@@ -87,7 +90,7 @@ function createSplittingContext(defaultValue) {
87
90
  function Provider(props) {
88
91
  let children = props.memo ? useEqualMemo(
89
92
  () => props.children,
90
- typeof props.memo === "boolean" ? [] : props.memo
93
+ props.memo === true ? [] : props.memo
91
94
  ) : props.children;
92
95
  for (const key of keys) {
93
96
  const Context = contexts[key];
package/dist/index.mjs CHANGED
@@ -11,6 +11,8 @@ function useConstant(fn) {
11
11
  return ref.current.v;
12
12
  }
13
13
  useConstant.whyDidYouRender = true;
14
+ var AsyncFunction = (async () => {
15
+ }).constructor;
14
16
  function equal(a, b) {
15
17
  if (a === b) return true;
16
18
  if ((a === null || a === void 0) && (b === null || b === void 0))
@@ -35,6 +37,7 @@ function equal(a, b) {
35
37
  return a.getTime() === b.getTime();
36
38
  case RegExp:
37
39
  case Function:
40
+ case AsyncFunction:
38
41
  return a.toString() === b.toString();
39
42
  case Map:
40
43
  case Set:
@@ -85,7 +88,7 @@ function createSplittingContext(defaultValue) {
85
88
  function Provider(props) {
86
89
  let children = props.memo ? useEqualMemo(
87
90
  () => props.children,
88
- typeof props.memo === "boolean" ? [] : props.memo
91
+ props.memo === true ? [] : props.memo
89
92
  ) : props.children;
90
93
  for (const key of keys) {
91
94
  const Context = contexts[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/react",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -35,12 +35,12 @@
35
35
  ],
36
36
  "peerDependencies": {
37
37
  "react": "*",
38
- "@faasjs/browser": "3.5.0"
38
+ "@faasjs/browser": "3.5.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/react": "*",
42
42
  "react": "*",
43
- "@faasjs/browser": "3.5.0"
43
+ "@faasjs/browser": "3.5.2"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=22.0.0",