Skip to content

Commit

Permalink
Add documentation on how to use the entangle antlers tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Siewertsen committed Jan 4, 2021
1 parent 56fbe45 commit bc6e598
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ class ShowArticles extends Component
}
```

### Entangle: Sharing State Between Livewire And Alpine
In case you want to share state between Livewire and Alpine, there is a Blade directive called @entangle:
[Livewire docs](https://laravel-livewire.com/docs/2.x/alpine-js#:~:text=Livewire%20has%20an%20incredibly%20powerful,other%20will%20also%20be%20changed.)

To be usable with Antlers, we do provide an dedicated Tag:
```html
<!-- With Antlers -->
<div x-data="{ open: {{ livewire:entangle property='showDropdown' }} }">

<!-- With Blade -->
<div x-data="{ open: @entangle('showDropdown').defer }">
```

## Credits

Thanks to:
Expand Down

0 comments on commit bc6e598

Please sign in to comment.