@desynova-digital/player 3.9.5 → 3.9.7
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/components/Player.js +27 -21
- package/package.json +1 -1
package/components/Player.js
CHANGED
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
8
|
|
|
9
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
10
|
-
|
|
11
9
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
12
10
|
|
|
13
11
|
var _propTypes = require('prop-types');
|
|
@@ -269,29 +267,37 @@ var Player = function (_Component) {
|
|
|
269
267
|
* this.actions.toggleFullscreen(player);
|
|
270
268
|
*/
|
|
271
269
|
}
|
|
270
|
+
|
|
271
|
+
// shouldComponentUpdate(nextProps) {
|
|
272
|
+
// // Rendering the component only if passed props value is changed
|
|
273
|
+
|
|
274
|
+
// const replacerFunc = () => {
|
|
275
|
+
// const visited = new WeakSet();
|
|
276
|
+
// return (key, value) => {
|
|
277
|
+
// if (typeof value === 'object' && value !== null) {
|
|
278
|
+
// if (visited.has(value)) {
|
|
279
|
+
// return;
|
|
280
|
+
// }
|
|
281
|
+
// visited.add(value);
|
|
282
|
+
// }
|
|
283
|
+
// return value;
|
|
284
|
+
// };
|
|
285
|
+
// };
|
|
286
|
+
|
|
287
|
+
// if ( JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc()) ) {
|
|
288
|
+
// return true;
|
|
289
|
+
// } else {
|
|
290
|
+
// return false;
|
|
291
|
+
// }
|
|
292
|
+
// }
|
|
293
|
+
|
|
272
294
|
}, {
|
|
273
295
|
key: 'shouldComponentUpdate',
|
|
274
|
-
value: function shouldComponentUpdate(nextProps) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
var replacerFunc = function replacerFunc() {
|
|
278
|
-
var visited = new WeakSet();
|
|
279
|
-
return function (key, value) {
|
|
280
|
-
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) {
|
|
281
|
-
if (visited.has(value)) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
visited.add(value);
|
|
285
|
-
}
|
|
286
|
-
return value;
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
if (JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc())) {
|
|
291
|
-
return true;
|
|
292
|
-
} else {
|
|
296
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
297
|
+
if (_.isEqual(nextProps, this.props)) {
|
|
293
298
|
return false;
|
|
294
299
|
}
|
|
300
|
+
return true;
|
|
295
301
|
}
|
|
296
302
|
}, {
|
|
297
303
|
key: 'componentDidUpdate',
|