Support message & type in ToastOptions #271
jamesarosen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current API for adding toasts uses separate functions for each type:
This is an excellent API for direct programmatic access!
But it's a bit unwieldy for abstraction. If I want to build a mechanism for defining toasts server-side, then passing the data to the client, then showing a toast, I need to use a
switch
statement ontype
to decide which of these functions to call.I'd love to be able to do this:
not because I want to write that code, but because I want to write this code:
instead of having to do this:
Beta Was this translation helpful? Give feedback.
All reactions