Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[USER_ID, ANON_ID, USER_TRAITS].map((key) => {
storage.removeItem(key)
})
/* eslint-enable */
return store => next => action => {
const { type, key, value, options } = action
if (type === EVENTS.setItem || type === EVENTS.removeItem) {
if (action.abort) {
return next(action)
}
// Run storage set or remove
if (type === EVENTS.setItem) {
storage.setItem(key, value, options)
} else {
storage.removeItem(key, options)
}
}
return next(action)
}
}