slax/lib/slax_web/live/socket_helpers.ex
Joao P Dubas 489be57db7
feat(chat): simplify socket response
Add helper methods to create the tuples `{:ok, socket}` and
`{:noreply, socket}`, and make them available in `SlaxWeb` module.
2025-02-05 00:05:49 +00:00

10 lines
209 B
Elixir

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