Source: ryangjchandler.co.uk

Alpine 3.x Tips and Tricks

Category: PHP

At the time of writing this article, Alpine Day has finished and Alpine 3.x has only been out a few hours. The new documentation states that components powered by Alpine.data declarations that contain an init function will automatically have the init function called. This is great and saves you some time since you don't need to hook up the x-init directive. After reading through the source code, it turns out you can actually add an init function to any data object and Alpine will still call that function automatically.

This is something that Spruce supported to, so if you used that with Alpine 2.x you'll be familiar with this one.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners