navigateToTeams(): Observable<Action> {
return this.actions$
.pipe(
ofTypeDeepOne<AddTeam>(
TeamActionTypes.ADD_TEAM,
),
map(({payload: {team}}) => team.id),
switchMap(() => {
const richDialogRef = this.dialog.openRichContent({
data: {
message: 'Team has been created',
buttonText: 'Continue to team list',
icon: {
name: IconNames.TRASH,
config: {
size: 10,
colorActive: '#676767',
colorBase: '#676767'
}
},
linkText: 'Add a user to the team ⟶'
}
});
return richDialogRef.afterClosed();
}),
switchMap((result) => {
console.log(result);
const action = result.isOnButton ? new Back() : new Go({path: ['/admin/team/1232312/user']});
return from([action, new PersistTeams()]);
}),
);
}
не делать лишний map сделать вложенный свитчмап
Обсуждают сегодня