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.