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

feat: toast.promise(async () => {}) #301

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kagurazaka-0
Copy link

@kagurazaka-0 kagurazaka-0 commented Aug 12, 2023

I wanted to use multiple awaits in toast.promote, but that was an error.
I implemented it so that it can be done.

toast.promise(
  async () => {
    await fetch();
    await fetch();
    await fetch();
  },
  {
    loading: 'Loading',
    success: 'Got the data',
    error: 'Error when fetching',
  }
);

@vercel
Copy link

vercel bot commented Aug 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-hot-toast ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2023 7:40am

@SidouGmr7
Copy link

SidouGmr7 commented Mar 19, 2024

u can use async function with await for each

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

Successfully merging this pull request may close these issues.

None yet

2 participants