Loading video...
Video Failed to Load
stumbled on a new Livewire pattern I'm pretty excited about - check it
45,676 views • 2 years ago •via X (Twitter)
11 Comments

I'll probably record a screencast or something showing you how soon

Is the secret to use wire:model.optimistic? And if not could it be made that simple? Or maybe it's already simple enough idk.

ooooh that'd be a pretty cool API

Your short-form demos are 🔥 Really impressed with what you're building with Livewire! Just sent a DM (it's not a nudge to update Chrome) 🙊

hahaha, not updating chrome is my brand now, have to stay consistent with it

What happens if the server fails to fulfill the request? Does the item come back for the DELETE request?

I believe so yes

when I stumble on stuff it’s like “neat a new hot key for Terminal”. This is less a stumble and more a perfect 10 dismount

Dude doing things optimistically like this makes sense 90% of the time. Looks and performs so fluidly. I'm looking forward to that screencast!

Really interested in your method here. My initial thought would be to push/mutate items directly on $wire.items array and then AlpineJS loop over those to render the items. Finally set a watcher on the $wire.items and call an update method to do the server side logic.

right, so that's the way you would THINK to do it, but this is a much simpler way - maybe I'll record something demoing the technique tomorrow
