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(): promise optional success/error msg #179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

n33pm
Copy link

@n33pm n33pm commented May 4, 2022

In some cases there is no success or error msg
eg. redirect after success.

@vercel
Copy link

vercel bot commented May 4, 2022

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

Name Status Preview Updated
react-hot-toast ✅ Ready (Inspect) Visit Preview May 4, 2022 at 2:57PM (UTC)

@McSam94
Copy link

McSam94 commented Jul 11, 2022

any update on this PR?

@rcbevans
Copy link

Been trying to figure out how to skip error messages in the case of user cancellation, is there anything holding up getting this in?

...opts?.success,
});
if (msgs.success)
toast.success(resolveValue(msgs.success, p), {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing ValueOrFunction allows for null as a return value, it also seems reasonable that if a user returns null from the success/error function it could skip the toast. This seems preferable since especially in the case of errors, whether to show an error may itself be conditional on the type of Error raised.

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.

3 participants