This is the Livewire framework for Laravel
HTML:
<button wire:click="$emit('postAdded')">
PHP:
protected $listeners = ['postAdded' => 'showPostAddedMessage'];
public function showPostAddedMessage()
{
// Do stuff
}
public function render()
{
return view('livewire.index');
}
Clicking the button calls showPostAddedMessage() and after that render(). How can I listen for an event without calling render()?