diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts index faa9efdb..c0631f7f 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts @@ -123,21 +123,18 @@ export class Effects { { dispatch: false } ); - read$ = createEffect( - () => { - return this.actions$.pipe( - ofType(read), - switchMap(req => { - return this.eventProtocolService.read(req).pipe( - map((res: ReadResponse) => { - readNotification({ noti: res }); - }), - catchError(error => of(readFailure({ error }))) - ); - }) - ); - }, - { dispatch: false } + read$ = createEffect(() => + this.actions$.pipe( + ofType(read), + exhaustMap(req => + this.eventProtocolService.read(req).pipe( + map((res: ReadResponse) => { + return readNotification({ noti: res }); + }), + catchError(error => of(readFailure({ error }))) + ) + ) + ) ); readNotification$ = createEffect(