Move variable assignments around to be more clear

This commit is contained in:
Steve Klebanoff
2018-11-15 13:54:35 -08:00
parent 71aeb7cddc
commit ed26f5af98

View File

@@ -12,11 +12,13 @@ import { State } from './reducer';
export const analyticsMiddleware: Middleware = store => next => middlewareAction => {
const prevState = store.getState() as State;
const nextAction = next(middlewareAction) as Action;
const nextState = store.getState() as State;
const curAccount = nextState.providerState.account;
const prevAccount = prevState.providerState.account;
const nextAction = next(middlewareAction) as Action;
const curState = store.getState() as State;
const curAccount = curState.providerState.account;
switch (nextAction.type) {
case ActionTypes.SET_ACCOUNT_STATE_READY:
if (curAccount.state === AccountState.Ready && !_.isEqual(curAccount, prevAccount)) {