Prevent Livewire Event Refresh

I have a Table Widget that I would like to receive events when an Eloquent Model is updated, but I would like to prevent the component from refreshing the table data automatically. I have the following code blocks
protected function getListeners(): array
{
return [
"echo:InvoiceUpdateNotifications,InvoiceUpdateNotification" => 'onInvoiceUpdated',
];
}
public function onInvoiceUpdated(Invoice $record) {
$this->showRefresh = true;
}
protected function getListeners(): array
{
return [
"echo:InvoiceUpdateNotifications,InvoiceUpdateNotification" => 'onInvoiceUpdated',
];
}
public function onInvoiceUpdated(Invoice $record) {
$this->showRefresh = true;
}
which correctly receives the event from my models. I have a table header action tied to the showRefresh variable that appears correctly when the event is triggered, so I know that the method is being called correctly. However, the table data also refreshes automatically. My goal on this is to require the user to request new data so that the location of items doesn't shift around as there are other components on the page that provide a process for the user to work through. I don't want the table to change without the user's knowledge, to rpevent confusion. When I remove the listener, the table does not refresh (the event is still being broadcast).
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server