diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
commit | 35703539d0f2b4ddb3b11d0de8c9634af59ab71f (patch) | |
tree | ae3731221dbbb3a6fa40060a8d916cfd3f738289 /packages/website/ts/redux/analyticsMiddleware.ts | |
parent | 92a1fde5b1ecd81b07cdb5bf0c9c1cd3544799db (diff) | |
download | dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.gz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.zst dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.zip |
Deploy @dexon-foundation/0x.jsstable
Diffstat (limited to 'packages/website/ts/redux/analyticsMiddleware.ts')
-rw-r--r-- | packages/website/ts/redux/analyticsMiddleware.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/packages/website/ts/redux/analyticsMiddleware.ts b/packages/website/ts/redux/analyticsMiddleware.ts deleted file mode 100644 index 51d39a5d7..000000000 --- a/packages/website/ts/redux/analyticsMiddleware.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Middleware } from 'redux'; -import { State } from 'ts/redux/reducer'; -import { ActionTypes } from 'ts/types'; -import { analytics } from 'ts/utils/analytics'; - -export const analyticsMiddleware: Middleware = store => next => action => { - const nextAction = next(action); - const nextState = (store.getState() as any) as State; - switch (action.type) { - case ActionTypes.UpdateInjectedProviderName: - analytics.addEventProperties({ - injectedProviderName: nextState.injectedProviderName, - }); - break; - case ActionTypes.UpdateNetworkId: - analytics.addEventProperties({ - networkId: nextState.networkId, - }); - break; - case ActionTypes.UpdateUserAddress: - analytics.addUserProperties({ - ethAddress: nextState.userAddress, - }); - break; - case ActionTypes.UpdateUserEtherBalance: - if (nextState.userEtherBalanceInWei) { - analytics.addUserProperties({ - ethBalance: nextState.userEtherBalanceInWei.toString(), - }); - } - break; - default: - break; - } - return nextAction; -}; |