feat(chat): simplify socket response
Add helper methods to create the tuples `{:ok, socket}` and `{:noreply, socket}`, and make them available in `SlaxWeb` module.
This commit is contained in:
9
lib/slax_web/live/socket_helpers.ex
Normal file
9
lib/slax_web/live/socket_helpers.ex
Normal file
@@ -0,0 +1,9 @@
|
||||
defmodule SlaxWeb.SocketHelpers do
|
||||
@moduledoc """
|
||||
Helper functions to encapsulate a socket into proper tuples.
|
||||
"""
|
||||
|
||||
def ok(socket), do: {:ok, socket}
|
||||
|
||||
def noreply(socket), do: {:noreply, socket}
|
||||
end
|
Reference in New Issue
Block a user