WIP - add extractor, generate snippet_data
This commit is contained in:
18
node_modules/shallow-compare/lib/index.js
generated
vendored
Normal file
18
node_modules/shallow-compare/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
// Pulled from react-compat
|
||||
// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
|
||||
function shallowDiffers(a, b) {
|
||||
for (var i in a) {
|
||||
if (!(i in b)) return true;
|
||||
}for (var _i in b) {
|
||||
if (a[_i] !== b[_i]) return true;
|
||||
}return false;
|
||||
}
|
||||
|
||||
exports.default = function (instance, nextProps, nextState) {
|
||||
return shallowDiffers(instance.props, nextProps) || shallowDiffers(instance.state, nextState);
|
||||
};
|
||||
|
||||
module.exports = exports["default"];
|
||||
Reference in New Issue
Block a user