Auto-removing notices from a turbo_stream
I am appending a notice partial via turbo_stream on a few actions for a model. I am running into an issue on figuring out the best way to remove these notices after a set period of time.
The actual javascript on doing it is fine, but with the content being added via a turbo_stream I am not sure how to watch for that.
I have tried wrapping the notice partial with a data-controller to load a stimulus controller, but that doesn't fire when this partial is added.
I also tried listening for turbo events like load, but that isn't triggered either when this partial gets added.
What can I listen to, if anything, to run JS after a turbo_steam even has taken place?
Do you mean like a flash notice? you can do it as a
function myFunction() {
setTimeout(function(){ alert("Hello"); }, 3000);
}