comfirmDialog not return any value

UI Components for Angular
Post Reply
octagono
Posts: 1
Joined: 19 Feb 2023, 21:58

19 Feb 2023, 22:13

im trying to make this wiork, the exhaustMap never get the retuen value,
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(_))
        )
    }


Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests