mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
EventBus: add origin to all events and support nested EventBus (#33548)
This commit is contained in:
@@ -18,15 +18,19 @@ export const AnnotationPicker = ({ annotation, events, onEnabledChanged }: Annot
|
||||
const onCancel = () => getDashboardQueryRunner().cancel(annotation);
|
||||
|
||||
useEffect(() => {
|
||||
const started = events.subscribe(AnnotationQueryStarted, (event) => {
|
||||
if (event.payload === annotation) {
|
||||
setLoading(true);
|
||||
}
|
||||
const started = events.getStream(AnnotationQueryStarted).subscribe({
|
||||
next: (event) => {
|
||||
if (event.payload === annotation) {
|
||||
setLoading(true);
|
||||
}
|
||||
},
|
||||
});
|
||||
const stopped = events.subscribe(AnnotationQueryFinished, (event) => {
|
||||
if (event.payload === annotation) {
|
||||
setLoading(false);
|
||||
}
|
||||
const stopped = events.getStream(AnnotationQueryFinished).subscribe({
|
||||
next: (event) => {
|
||||
if (event.payload === annotation) {
|
||||
setLoading(false);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user