-
Notifications
You must be signed in to change notification settings - Fork 98
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
refactor(Toaster): fix incompatibility of different Toaster APIs #1987
base: main
Are you sure you want to change the base?
Conversation
Preview is ready. |
Visual Tests Report is ready. |
9d04f6b
to
e788ad6
Compare
remove(name: string) { | ||
this.toasts = removeToast(this.toasts, name); | ||
|
||
this.notify(); | ||
} |
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.
I think we need to maintain destroy()
method, let it call removeAll
underneath
|
||
import {ToasterContext} from './ToasterContext'; | ||
import {ToastsContext} from './ToastsContext'; | ||
|
||
type Props = React.PropsWithChildren<{}>; | ||
type Props = React.PropsWithChildren<{ | ||
toaster: ToasterSingleton; |
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.
This is definitely breaking change, please change target branch to next
private notify() { | ||
for (const listener of this.listeners) { | ||
listener(this.toasts); | ||
} | ||
} |
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.
Please separate subscribe pattern from Toaster class to separate base class EventEmitter
Please describe all breaking changes in PR description |
PR is made to implement this RFC gravity-ui/rfc#15