simple-object-state
Version:
An experiemental object oriented state mangment lib
20 lines • 700 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Shallow Equal function should talk two states and compare if they are
* the same. The same being the a shallow comparison on sub-objects
* within the state and also accepting a partial of the current state,
* as the next state parameter. Meaning that only the keys of the nextState
* parameter will be checked
*/
function shallowEqual(_a) {
var nextState = _a.nextState, state = _a.state;
for (var key in nextState) {
if (nextState[key] !== state[key]) {
return false;
}
}
return true;
}
exports.shallowEqual = shallowEqual;
//# sourceMappingURL=ShallowEqual.js.map