After three days, I figured out that if you use wire:stream() in Livewire, the only way (that I found) to update other bits of the UI before the stream starts, is to do another wire:stream() before that. Anything that uses events gets delayed until after all the streams are complete.
So I'm using View::make('..',)->render() to pre-render a piece of the UI, and then using stream() to update that on the frontend, before the next stream() starts.
I made my first ever Laravel screencast, on vector databases with Laravel www.youtube.com/watch?v=2XKsy-242_8
Any Livewire experts here that might have thoughts on this? I am using wire:stream() for streaming a chat. *Before* the stream starts, I want to dispatch() something to update another Livewire component. However, Livewire's execution model means that dispatches only happen *after* the stream is complete.
I've tried a bunch of things, but no luck so far. Thoughts? Approaches?
I figured out a way to use the wonderfully designed toast messages in Flux in oldschool Laravel controllers. They are normally designed to be used from LiveWire, but I don't use LiveWire for every page, and I really wanted to use the toast messages everywhere.
Here are the docs, feel free to use or send thoughts!
This lets you dispatch a flux toast message from within an old fashioned Laravel controller.
github.com/petervandijck/oldschool-fluxtoasts
@calebporzio