Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit b8bebc9

Browse files
committed
Change switchMap to exhaustMap
1 parent 5dbecb3 commit b8bebc9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48671,7 +48671,7 @@ var typesafe_actions_1 = __webpack_require__(/*! typesafe-actions */ "./node_mod
4867148671
var actions = __webpack_require__(/*! ../actions */ "./src/shared/store/actions/index.ts");
4867248672
var Api_1 = __webpack_require__(/*! ../../services/Api */ "./src/shared/services/Api.ts");
4867348673
var weatherGetEpic = function (action$, store) {
48674-
return action$.pipe(operators_1.filter(typesafe_actions_1.isActionOf(actions.weatherGetAction)), operators_1.switchMap(function (action) {
48674+
return action$.pipe(operators_1.filter(typesafe_actions_1.isActionOf(actions.weatherGetAction)), operators_1.exhaustMap(function (action) {
4867548675
return rxjs_1.from(Api_1.getWeather(action.payload.lat, action.payload.lng)).pipe(operators_1.map(actions.weatherSetAction), operators_1.catchError(function (error) { return rxjs_1.of(actions.weatherErrorAction(error)); }));
4867648676
}));
4867748677
};

dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shared/store/epics/WeatherEpic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Epic } from "redux-observable";
22
import { from, of } from "rxjs";
3-
import { switchMap, filter, map, catchError } from "rxjs/operators";
3+
import { exhaustMap, filter, map, catchError } from "rxjs/operators";
44
import { ActionType, isActionOf } from "typesafe-actions";
55

66
import * as actions from "../actions";
@@ -14,7 +14,7 @@ import { getWeather } from "../../services/Api";
1414
const weatherGetEpic: Epic<Action, Action, RootState> = (action$, store) =>
1515
action$.pipe(
1616
filter(isActionOf(actions.weatherGetAction)),
17-
switchMap(action =>
17+
exhaustMap(action =>
1818
from(getWeather(action.payload.lat, action.payload.lng)).pipe(
1919
map(actions.weatherSetAction),
2020
catchError(error => of(actions.weatherErrorAction(error)))

0 commit comments

Comments
 (0)