How trigger a Toast from multiple callabcks

Hello all,
I have to implement the toast in the dash Python app; I have a multipage app and multiple callbacks on a single page. I am using dash-bootstrap [toast] (Toast - dbc docs) for this purpose. I have to trigger the toast whenever some condition is met or something inside the callback code occurs. So to trigger this toast we need callaback,’

So the question is: how can we trigger this toast from multiple callbacks? while Dash doesn’t allow one output in multiple callbacks. So how can I achieve this?

Note: I don’t want to create multiple toast components on one page. My callbacks are dynamically created inside a loop in accordance with the current condition.

You might try the multiplexer transform from das-extensions:

2 Likes

My app is now in production, so I don’t want to change its base structure as multiplexer do.

The other option is, that you merge all single callbacks which trigger the toast into one callback:

Also interesting in this context is @jinnyzor ’ s answer:

What do you mean by changing the structure? The changes needed are very minimal

1 Like

Yes, I know the changes are minimal. need to change the main Dash object. But my concern is its future support and any limitations. What’s your point on that? Is it safe?

yes i am also thinking this way to use dcc.Store and pattern matching.