How to use the decentraland-dapps/dist/modules/analytics/middleware.createAnalyticsMiddleware function in decentraland-dapps

To help you get started, we’ve selected a few decentraland-dapps 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 decentraland / builder / src / modules / common / store.ts View on Github external
data: scene
        }
      }
    }

    return newState
  },
  onError: (err, store) => {
    const isQuotaModalOpen = !!getOpenModals(store.getState())['QuotaExceededModal']
    if (err instanceof DOMException && err.name === 'QuotaExceededError' && !isQuotaModalOpen) {
      store.dispatch(openModal('QuotaExceededModal'))
    }
  }
})

const analyticsMiddleware = createAnalyticsMiddleware(env.get('REACT_APP_SEGMENT_API_KEY'))

const middlewares = [historyMiddleware, sagasMiddleware, loggerMiddleware, storageMiddleware, analyticsMiddleware]

const middleware = applyMiddleware(...middlewares)

const enhancer = composeEnhancers(middleware)
const store = createStore(rootReducer, enhancer)

sagasMiddleware.run(rootSaga)
loadStorageMiddleware(store)

export function getState() {
  return store.getState()
}

window.onbeforeunload = function() {