shallowCompare = (obj1, obj2) => {
  const obj1Keys = Object.keys(obj1);
  return (
    obj1Keys.length === Object.keys(obj2).length &&
    obj1Keys.every(key => obj2.hasOwnProperty(key) && obj1[key] === obj2[key])
  );
}
Shallow compares two objects.
@param {Object} obj1 The first object to compare.
@param {Object} obj2 The second object to compare.