@gravity-ui/dashkit 8.5.0-beta.5 → 8.6.0
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/README.md
CHANGED
|
@@ -475,6 +475,7 @@ const CustomThemeWrapper = (props: {
|
|
|
475
475
|
By default, storybook runs on `http://localhost:7120/`.
|
|
476
476
|
New changes from a project aren't always picked up when storybook is running, so it's better to rebuild a project manually and restart storybook.
|
|
477
477
|
|
|
478
|
+
|
|
478
479
|
### Example of an nginx config for development on a dev machine
|
|
479
480
|
|
|
480
481
|
```bash
|
|
@@ -6,14 +6,12 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
7
7
|
const useDeepEqualMemo = (predicate, deps) => {
|
|
8
8
|
const previousValueRef = react_1.default.useRef({});
|
|
9
|
-
const callbackRef = react_1.default.useRef(predicate);
|
|
10
|
-
callbackRef.current = predicate;
|
|
11
9
|
return react_1.default.useMemo(() => {
|
|
12
10
|
const value = predicate();
|
|
13
11
|
if (!(0, isEqual_1.default)(previousValueRef.current, value)) {
|
|
14
12
|
previousValueRef.current = value;
|
|
15
13
|
}
|
|
16
14
|
return previousValueRef.current;
|
|
17
|
-
}, [
|
|
15
|
+
}, [previousValueRef, ...deps]);
|
|
18
16
|
};
|
|
19
17
|
exports.useDeepEqualMemo = useDeepEqualMemo;
|
|
@@ -2,13 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
export const useDeepEqualMemo = (predicate, deps) => {
|
|
4
4
|
const previousValueRef = React.useRef({});
|
|
5
|
-
const callbackRef = React.useRef(predicate);
|
|
6
|
-
callbackRef.current = predicate;
|
|
7
5
|
return React.useMemo(() => {
|
|
8
6
|
const value = predicate();
|
|
9
7
|
if (!isEqual(previousValueRef.current, value)) {
|
|
10
8
|
previousValueRef.current = value;
|
|
11
9
|
}
|
|
12
10
|
return previousValueRef.current;
|
|
13
|
-
}, [
|
|
11
|
+
}, [previousValueRef, ...deps]);
|
|
14
12
|
};
|