victory-shared-events 31.1.0 → 31.2.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.
|
@@ -27,6 +27,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
27
27
|
import React from "react";
|
|
28
28
|
import PropTypes from "prop-types";
|
|
29
29
|
import { PropTypes as CustomPropTypes, Events, Helpers, Timer } from "victory-core";
|
|
30
|
+
import isEqual from "react-fast-compare";
|
|
30
31
|
|
|
31
32
|
var VictorySharedEvents =
|
|
32
33
|
/*#__PURE__*/
|
|
@@ -55,11 +56,15 @@ function (_React$Component) {
|
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
}, {
|
|
58
|
-
key: "
|
|
59
|
-
value: function
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
key: "shouldComponentUpdate",
|
|
60
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
61
|
+
if (!isEqual(this.props, nextProps)) {
|
|
62
|
+
this.baseProps = this.getBaseProps(nextProps);
|
|
63
|
+
var externalMutations = this.getExternalMutations(nextProps, this.baseProps);
|
|
64
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return true;
|
|
63
68
|
}
|
|
64
69
|
}, {
|
|
65
70
|
key: "getTimer",
|
|
@@ -21,6 +21,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var _victoryCore = require("victory-core");
|
|
23
23
|
|
|
24
|
+
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -70,11 +72,15 @@ function (_React$Component) {
|
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
74
|
}, {
|
|
73
|
-
key: "
|
|
74
|
-
value: function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
key: "shouldComponentUpdate",
|
|
76
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
77
|
+
if (!(0, _reactFastCompare.default)(this.props, nextProps)) {
|
|
78
|
+
this.baseProps = this.getBaseProps(nextProps);
|
|
79
|
+
var externalMutations = this.getExternalMutations(nextProps, this.baseProps);
|
|
80
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return true;
|
|
78
84
|
}
|
|
79
85
|
}, {
|
|
80
86
|
key: "getTimer",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-shared-events",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.2.0",
|
|
4
4
|
"description": "Shared Event Helper for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash": "^4.17.5",
|
|
23
23
|
"prop-types": "^15.5.8",
|
|
24
|
-
"
|
|
24
|
+
"react-fast-compare": "^2.0.0",
|
|
25
|
+
"victory-core": "^31.2.0"
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"version": "nps build-libs && nps build-dists"
|
|
@@ -2,6 +2,7 @@ import { assign, isFunction, defaults, isEmpty, fromPairs } from "lodash";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { PropTypes as CustomPropTypes, Events, Helpers, Timer } from "victory-core";
|
|
5
|
+
import isEqual from "react-fast-compare";
|
|
5
6
|
|
|
6
7
|
export default class VictorySharedEvents extends React.Component {
|
|
7
8
|
static displayName = "VictorySharedEvents";
|
|
@@ -73,10 +74,13 @@ export default class VictorySharedEvents extends React.Component {
|
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
shouldComponentUpdate(nextProps) {
|
|
78
|
+
if (!isEqual(this.props, nextProps)) {
|
|
79
|
+
this.baseProps = this.getBaseProps(nextProps);
|
|
80
|
+
const externalMutations = this.getExternalMutations(nextProps, this.baseProps);
|
|
81
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
getTimer() {
|