question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading toast is removed before resolving the promise.

See original GitHub issue

I noticed a weird behavior when running a promise that takes fairly long (about 30s) the loading toast is automatically dismissed even before resolving the promise, when it’s resolved the success toast appears.

Can you reproduce this? Try having a promise that takes about 30 or 40 seconds to execute.

toast.promise(subtitlesPromise, {
  loading: 'Generating your subtitles, please wait...',
  success: 'Subtitles generated!',
  error: 'Error generating subtitles.',
});

Thanks Timo for this awesome library!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
timolinscommented, Mar 14, 2021

Yep, sorry for the delay. Currently planing out v1.1 which includes quite a few things I want to get right. I’ll hope to release in the next couple of days.

0reactions
iamanas20commented, Apr 6, 2021

Any updates on this? @timolins

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling promises | React-Toastify - GitHub Pages
The library exposes a toast.promise function. Supply a promise or a function that return a promise and the notification will be updated if...
Read more >
How to use react-toastify promise in axios - Stack Overflow
According to toast API https://fkhadra.github.io/react-toastify/promise/ the syntax should be
Read more >
How to use react-hot-toast with async await Axios call #40
postVersionBulkAction(params) toast.promise(promise, { loading: 'Saving. ... and I have succesfully removed thousands of lines of redux ...
Read more >
toast() API
Toasts will auto-remove after 1 second by default. Dismiss a single toast. const toastId = toast.loading( ...
Read more >
Create smoking hot toast notifications in React with ... - Daily.dev
It maps the Promise to the notification used and updates automatically when the Promise is resolved or failed. You can give proper arguments...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found