Skip to content

Commit 10868bb

Browse files
authored
Update README.md
1 parent 2098bfb commit 10868bb

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ import { convertValueWithBaseRateToTargetRate } from './utils';
534534
import * as currencyConverterSelectors from './selectors';
535535
import * as currencyRatesSelectors from '../currency-rates/selectors';
536536

537-
const changeCurrencyEpic: Epic<Action, RootState> = (action$, store) =>
537+
const recalculateTargetValueOnCurrencyChange: Epic<Action, RootState> = (action$, store) =>
538538
action$.ofType(
539539
actionCreators.changeBaseCurrency.type,
540540
actionCreators.changeTargetCurrency.type,
@@ -544,11 +544,10 @@ const changeCurrencyEpic: Epic<Action, RootState> = (action$, store) =>
544544
currencyRatesSelectors.getBaseCurrencyRate(store.getState()),
545545
currencyRatesSelectors.getTargetCurrencyRate(store.getState()),
546546
);
547-
548-
return actionCreators.changeTargetValue(value);
547+
return actionCreators.recalculateTargetValue(value);
549548
});
550549

551-
const changeBaseValueEpic: Epic<Action, RootState> = (action$, store) =>
550+
const recalculateTargetValueOnBaseValueChange: Epic<Action, RootState> = (action$, store) =>
552551
action$.ofType(
553552
actionCreators.changeBaseValue.type,
554553
).map((action: any) => {
@@ -557,11 +556,10 @@ const changeBaseValueEpic: Epic<Action, RootState> = (action$, store) =>
557556
currencyRatesSelectors.getBaseCurrencyRate(store.getState()),
558557
currencyRatesSelectors.getTargetCurrencyRate(store.getState()),
559558
);
560-
561-
return actionCreators.changeTargetValue(value);
559+
return actionCreators.recalculateTargetValue(value);
562560
});
563561

564-
const changeTargetValueEpic: Epic<Action, RootState> = (action$, store) =>
562+
const recalculateBaseValueOnTargetValueChange: Epic<Action, RootState> = (action$, store) =>
565563
action$.ofType(
566564
actionCreators.changeTargetValue.type,
567565
).map((action: any) => {
@@ -570,12 +568,13 @@ const changeTargetValueEpic: Epic<Action, RootState> = (action$, store) =>
570568
currencyRatesSelectors.getTargetCurrencyRate(store.getState()),
571569
currencyRatesSelectors.getBaseCurrencyRate(store.getState()),
572570
);
573-
574-
return actionCreators.changeBaseValue(value);
571+
return actionCreators.recalculateBaseValue(value);
575572
});
576573

577574
export const epics = combineEpics(
578-
changeCurrencyEpic, changeBaseValueEpic, changeTargetValueEpic,
575+
recalculateTargetValueOnCurrencyChange,
576+
recalculateTargetValueOnBaseValueChange,
577+
recalculateBaseValueOnTargetValueChange,
579578
);
580579
```
581580

0 commit comments

Comments
 (0)