83 words, 1 min read
โ ๏ธ This post links to an external website. โ ๏ธ
Iโm not a fan of writing
{:ok, socket}and{:noreply, socket}in all of my LiveViews. We canโt pipe into them!So, I typically introduce a couple of
ok/1andnoreply/1helpers in every single LiveView:def ok(socket), do: {:ok, socket}def noreply(socket), do: {:noreply, socket}But it wasnโt until recently that a colleague of mine had the ๐ก brilliant idea to add them to the Web module!
Just drop them in the
MyAppWeb.live_view/0function. Now, theyโre automatically included in all LiveViews! ๐ฅณ
continue reading on www.elixirstreams.com
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.