Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
store.subscribe(() => {
const newSettings = store.getState().settings;
if (!isEqual(prevSettings, newSettings)) {
attempt(() => localStorage.setItem(SETTINGS_KEY, JSON.stringify(newSettings)));
}
prevSettings = newSettings;
});
return store;