From 647a514d2d206c4a512b2ad28834e667ceaefc5e Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 21 May 2019 17:18:36 -0700 Subject: [PATCH] Use ofType --- js/epics.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/epics.ts b/js/epics.ts index d8f99acb..23ec9e88 100644 --- a/js/epics.ts +++ b/js/epics.ts @@ -1,6 +1,7 @@ import { Observable, of, defer, concat } from "rxjs"; -import { filter, mergeMap, catchError } from "rxjs/operators"; -import { Action, AppState, Extras } from "./types"; +import { ofType } from "redux-observable"; +import { mergeMap, catchError } from "rxjs/operators"; +import { Action, Extras, AppState } from "./types"; import { MEDIA_TAG_REQUEST_INITIALIZED, SET_MEDIA_TAGS, @@ -15,7 +16,7 @@ export const fetchMediaTagsEpic = ( { requireMusicMetadata }: Extras ): Observable => { return actions.pipe( - filter(action => action.type === FETCH_MEDIA_TAGS), + ofType(FETCH_MEDIA_TAGS), mergeMap(action => { // TODO: Check out https://github.com/piotrwitek/typesafe-actions if (action.type !== FETCH_MEDIA_TAGS) {