-
Notifications
You must be signed in to change notification settings - Fork 93
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
Feature request: specify toastId when creating toaster #157
Comments
Is there a reason you can't map the returned toastId to your internal id once the toast is popped? Allowing for manually created toastIds tends to cause a number of issues for multiple container use cases. I'd prefer not to expand the API in this way unless absolutely necessary. |
There's no reason I can't map. But to map I will need to write additional code which is simply avoidable if I can provide toastId. Just to give you an idea: Maybe make a user provided 'tag' and than function to close by tag. |
Looks like I found another way. |
I'm glad you found a workaround. I'm still considering merging in your PR and making it a first class citizen of the API but I need to review duplicate toast checks first to make sure the behavior will remain consistent. |
This has been released in version 5.1.0. |
When I call pop like this toastId will be rewritten inside library:
I know I can change toastId in returned value but that will break timeouts logic.
If I want to remove toaster identified by '100' and add a new one also identified by '100'. Currently I will need to track a map of toastId's to my internal Id's.
I will take care: toastId's will be unique but they will make sense inside my application.
Basically the same logic implemented in WebNotifications with tag.
I can make a PR if you want.
The text was updated successfully, but these errors were encountered: