@homebound/beam 2.309.0 → 2.309.1
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/hooks/useComputed.js +6 -5
- package/package.json +13 -13
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.useComputed = void 0;
|
|
7
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
4
|
const mobx_1 = require("mobx");
|
|
9
5
|
const react_1 = require("react");
|
|
6
|
+
const shallowEqual_1 = require("../utils/shallowEqual");
|
|
10
7
|
/** Evaluates a computed function `fn` to a regular value and triggers a re-render whenever it changes. */
|
|
11
8
|
function useComputed(fn, deps) {
|
|
12
9
|
// We always return the useRef value, and use this just to trigger re-renders
|
|
@@ -37,7 +34,11 @@ function useComputed(fn, deps) {
|
|
|
37
34
|
// Only trigger a re-render if this is not the 1st autorun. Note
|
|
38
35
|
// that if deps has changed, we're inherently in a re-render so also
|
|
39
36
|
// don't need to trigger an additional re-render.
|
|
40
|
-
|
|
37
|
+
//
|
|
38
|
+
// Also, we avoid a deep equality, b/c if a `useComputed` is returning something
|
|
39
|
+
// complicated/cyclic, like ReactElement, deep equality will crawl into the guts
|
|
40
|
+
// of React/ReactFiber and cycle/infinite loop.
|
|
41
|
+
if (oldHasRun && !(0, shallowEqual_1.shallowEqual)(newValue, oldValue)) {
|
|
41
42
|
setTick((tick) => tick + 1);
|
|
42
43
|
}
|
|
43
44
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homebound/beam",
|
|
3
|
-
"version": "2.309.
|
|
3
|
+
"version": "2.309.1",
|
|
4
4
|
"author": "Homebound",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
"@homebound/tsconfig": "^1.0.3",
|
|
82
82
|
"@semantic-release/exec": "^6.0.3",
|
|
83
83
|
"@semantic-release/git": "^10.0.1",
|
|
84
|
-
"@storybook/addon-docs": "^7.0
|
|
85
|
-
"@storybook/addon-essentials": "^7.0
|
|
86
|
-
"@storybook/addon-interactions": "^7.0
|
|
87
|
-
"@storybook/addon-links": "^7.0
|
|
88
|
-
"@storybook/addon-mdx-gfm": "^7.0
|
|
89
|
-
"@storybook/addons": "^7.0
|
|
90
|
-
"@storybook/manager-api": "^7.0
|
|
91
|
-
"@storybook/mdx2-csf": "1.1.0",
|
|
92
|
-
"@storybook/react": "^7.0
|
|
93
|
-
"@storybook/react-vite": "^7.0
|
|
84
|
+
"@storybook/addon-docs": "^7.3.0",
|
|
85
|
+
"@storybook/addon-essentials": "^7.3.0",
|
|
86
|
+
"@storybook/addon-interactions": "^7.3.0",
|
|
87
|
+
"@storybook/addon-links": "^7.3.0",
|
|
88
|
+
"@storybook/addon-mdx-gfm": "^7.3.0",
|
|
89
|
+
"@storybook/addons": "^7.3.0",
|
|
90
|
+
"@storybook/manager-api": "^7.3.0",
|
|
91
|
+
"@storybook/mdx2-csf": "^1.1.0",
|
|
92
|
+
"@storybook/react": "^7.3.0",
|
|
93
|
+
"@storybook/react-vite": "^7.3.0",
|
|
94
94
|
"@storybook/testing-library": "^0.2.0",
|
|
95
95
|
"@testing-library/jest-dom": "^5.16.5",
|
|
96
96
|
"@tsconfig/recommended": "^1.0.2",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"chromatic": "^6.17.0",
|
|
108
108
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
109
109
|
"eslint": "^8.12.0",
|
|
110
|
-
"eslint-plugin-storybook": "^0.6.
|
|
110
|
+
"eslint-plugin-storybook": "^0.6.13",
|
|
111
111
|
"husky": "^5.1.1",
|
|
112
112
|
"identity-obj-proxy": "^3.0.0",
|
|
113
113
|
"jest": "^29.4.3",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"react": "^18.2.0",
|
|
122
122
|
"react-dom": "^18.2.0",
|
|
123
123
|
"semantic-release": "^20.1.0",
|
|
124
|
-
"storybook": "^7.0
|
|
124
|
+
"storybook": "^7.3.0",
|
|
125
125
|
"storybook-addon-designs": "beta",
|
|
126
126
|
"ts-jest": "^29.0.5",
|
|
127
127
|
"ts-node": "^10.9.1",
|