Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let changesDetected = false;
const storeIndex = this.store.state.index;
const innerIndex = this.innerStateIndex;
if (storeIndex.size !== innerIndex.size) {
changesDetected = this.detectChanges();
}
const storeKeys = Array.from(storeIndex.keys());
for (const key of storeKeys) {
const storeValue = storeIndex.get(key);
const innerValue = innerIndex.get(key);
if (changesDetected === false) {
if (innerValue === undefined) {
changesDetected = this.detectChanges();
} else if (!ObjectUtils.objectsAreEquivalent(storeValue, innerValue)) {
changesDetected = this.detectChanges();
}
}
this.innerStateIndex.set(key, Object.assign({}, storeValue));
}
}