return_helpers v0.0.1 ReturnHelpers

simple library that adds a piping possibility for easy returning from liveview Imagine socket =

socket
|> assign(valid: true)

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)