How to use the analytics-utils.storage.removeItem function in analytics-utils

To help you get started, we’ve selected a few analytics-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DavidWells / analytics / packages / analytics-core / src / modules / user.js View on Github external
[USER_ID, ANON_ID, USER_TRAITS].map((key) => {
        storage.removeItem(key)
      })
      /* eslint-enable  */
github DavidWells / analytics / packages / analytics-core / src / middleware / storage.js View on Github external
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)
  }
}