Move variable assignments around to be more clear
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user