In elixir is possible to use default arguments in function definitions, but I found it impossible to do so with single keyword list arguments like:
def do_stuff(
success: sucess \\ fn(conn) -> conn end,
error: error
) do
# ...
end
Also, I thought about avoiding this kind of "callback passing" style of coding by using something like JS promises but I couldn't find an implementation of promises for Elixir.
Maybe there's something built in right into the language that could help me write better code and closer abide to the elixir standards.
Main question: is possible to use default keyword arguments?
Side question: Is there something Elixir provides to help avoid this "callback passing" style of programming in favor of a more reactive/composable mechanism?