return_helpers v0.0.3 ReturnHelpers

Simple library that adds a piping possibility for easy returning from liveview

Imagine

  socket =
    socket
    |> assign(valid: true)
  {:noreply, socket}

to write like:

  socket
  |> assign(valid: true)
  |> noreply()

Looks cleaner ?

Link to this section Summary

Functions

Examples

iex(2)> socket = %{}
%{}
iex(3)> socket |> ok()
{:ok, %{}}
iex(4)> socket |> noreply()
{:noreply, %{}}

Link to this section Functions

Link to this function

noreply(return)

Link to this function

noreply(return, params)

Examples

iex(2)> socket = %{}
%{}
iex(3)> socket |> ok()
{:ok, %{}}
iex(4)> socket |> noreply()
{:noreply, %{}}
Link to this function

ok(return, params)

Link to this function

reply(return, params)