-
Notifications
You must be signed in to change notification settings - Fork 337
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
any update on this PR? |
Been trying to figure out how to skip error messages in the case of user cancellation, is there anything holding up getting this in? |
src/core/toast.ts
Outdated
...opts?.success, | ||
}); | ||
if (msgs.success) | ||
toast.success(resolveValue(msgs.success, p), { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree! Added this behaviour as well.
Sorry for the long wait! Made two small changes:
Merging now 👍 |
This is now released with |
In some cases there is no success or error msg
eg. redirect after success.