Я добавил mergeMap и положил туда takeUntil. Теперь это хорошо.
@Effect() createConversation$ = this.actions$.pipe(
ofType(CREATE_CONVERSATION),
map((action: CreateConversation) => action.payload),
withLatestFrom(this.store.pipe(select(selectConversation))),
mergeMap(([message, mdConversation]) => {
return this.httpService
.createConversation(mdConversation.data.taskId, message)
.pipe(
map(
result =>
new CreateConversationComplete({
id: result.data.id,
tmpId: mdConversation.data.id
})
),
catchError((error: MyError) => {
if (error.type === MyerrorTypes.NETWORK) {
return of(new CreateConversationRetry(message));
}
if (error.type === MyerrorTypes.APPLICATION) {
return of(new CreateConversationError(mdConversation.data));
}
}),
takeUntil(this.actions$.pipe(ofType(LOG_OUT)))
);
})
);
@Effect() createConversationRetry$ = this.actions$.pipe(
ofType(CREATE_CONVERSATION_RETRY),
mergeMap((action: CustomAction) =>
of(action).pipe(
delay(NETWORK_TIMEOUT),
map(data => new CreateConversation(action.payload)),
takeUntil(this.actions$.pipe(ofType(LOG_OUT)))
)
)
);