Reply-Function for LiveViews

I agree and did something similar to make the code easier to read IMO. Some might have objections because it adds special conventions to the code base but it works well for me. Especially the noreply/1 which is super simple.

def ok(value, extra \\ nil)
def ok(value, nil), do: {:ok, value}
def ok(value, extra), do: {:ok, value, extra}
def error(reason), do: {:error, reason}
def reply(state, res), do: {:reply, res, state}
def noreply(state), do: {:noreply, state}
2 Likes