Elixir and Phoenix tips

LiveView's Lifecycle Hooks

Ever want to handle a LiveView action (event, message, patch, etc.) across several LiveViews without having to duplicate the code? LiveView's attach_hook/4 helper is the thing for you!

How is `:page_title` updated?

You probably know that the `:page_title` assign is special in Phoenix -- it is the only dynamic assign in a layout. I always wondered: how does it work? How do they make it special? So, I did a bit of code spelunking. 🀿

Strong Arrows

Elixir might add types through gradual typing. But that comes with some challenges. Check out Elixir's new way of handling some of those gradual typing challenges with strong arrows.

Phoenix forms without changesets!

Typically, we back Phoenix forms with an Ecto changeset. But sometimes, I prefer having more separation between the UI and the changeset that stores data in the database. Check out how we can use the new `to_form/2` helper to do just that.

Want the latest Elixir Streams in your inbox?

    No spam. Unsubscribe any time.