there is not error in my code, everithing looks good.
Code: Select all
readonly _remove = this.effect<Item>((_) =>
_.pipe(
exhaustMap((post) => {
if (!post) {
return EMPTY;
}
return this.openModalConfirm().pipe(
exhaustMap((result) => {
if (result) {
return this.collection.delete({
request: post.id
? this.api.delete(post.id)
: of(null),
item: post,
});
}
return EMPTY;
})
);
})
)
);
public openModalConfirm(): Observable<Confirmation> {
return this.confirmationService.confirm({
message: 'Are you sure?',
accept: () => of(this.confirmationService.accept),
reject: () => of(false),
}).accept.pipe(
tap((_) => console.log(_))
)
}