Back

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.

1

152

In response to @petervandijck

I feel you on this one! Async vs sync add so much mental complexity for me. I've run into issues related to this in other ways as well. Eg firing open modal event, do some api calls, close modal event from within a closure and the modal never appears. To the dom, everything happened all at once. This was almost a week of my life figuring this out lol.

Now that I understand, it makes so much sense what's happening. But it really broke my brain for a bit there.

68

  • No matching results...
  • Searching...

/ 1000