Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION]: How to return description from a promise #92

Open
BayBreezy opened this issue Oct 18, 2024 · 2 comments
Open

[QUESTION]: How to return description from a promise #92

BayBreezy opened this issue Oct 18, 2024 · 2 comments

Comments

@BayBreezy
Copy link

Hello,

Quick question. How do I return a description after a promise is resolved?
The string returned is used as the title in both the success and error functions. I am not sure how to return a description along with the title

@RoyvanEmpel
Copy link

+1

@andriferry
Copy link

Hi @BayBreezy I see there same issue like you Please check this solution #84 (comment)

Or you can use this solution , You can running another toast in finally callback

const promise = () =>
            new Promise((resolve) => setTimeout(resolve, 2000));

        $toast.promise(promise, {
            loading: 'Loading...',
                finally: () => {
                    $toast.success('Success', {
                        description: `Hello, Demo Welcome Back`,
                    });
                },
        });

and it's work for me

Screen.Recording.2025-02-05.at.09.02.53.mov

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants