Skip to content

Commit

Permalink
refactor MarketSaga watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
gl2748 committed Jul 12, 2018
1 parent 76e4c3c commit daa8bac
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/app/redux/MarketSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import * as userActions from './UserReducer';
import { getAccount } from './SagaShared';

export const marketWatches = [
watchLocationChange,
watchUserLogin,
watchMarketUpdate,
takeLatest(userActions.SET_USER, fetchOpenOrders),
takeLatest('@@router/LOCATION_CHANGE', fetchMarket),
takeLatest(marketActions.UPDATE_MARKET, reloadMarket),
];

const wait = ms =>
Expand Down Expand Up @@ -86,15 +86,3 @@ export function* reloadMarket(reload_action) {
yield fetchMarket(reload_action);
yield fetchOpenOrders(reload_action);
}

export function* watchUserLogin() {
yield* takeLatest(userActions.SET_USER, fetchOpenOrders);
}

export function* watchLocationChange() {
yield* takeLatest('@@router/LOCATION_CHANGE', fetchMarket);
}

export function* watchMarketUpdate() {
yield* takeLatest(marketActions.UPDATE_MARKET, reloadMarket);
}

0 comments on commit daa8bac

Please sign in to comment.