#333

You can call a function in a livewire class component from the alpine js of the livewire view component using @this.call helper as follow:

— Livewire view markup —

<button x-on:click=”addPost(post)”></button>

<script>
addPost(post) {
$this.call(‘addPost’, post)
}
</script>