Skip to content

Instantly share code, notes, and snippets.

@TylerPachal
Created January 22, 2019 00:00
Show Gist options
  • Select an option

  • Save TylerPachal/307f81867adea2fb8797e7a24a50604b to your computer and use it in GitHub Desktop.

Select an option

Save TylerPachal/307f81867adea2fb8797e7a24a50604b to your computer and use it in GitHub Desktop.
def join_game(user_id, game_id) do
with {:user, {:ok, user}} <- get_user(user_id),
{:game, {:ok, game}} <- get_game(game_id),
# Etc...
end
defp get_user(id) do
{:user, Users.get(id)}
end
defp get_game(id) do
{:game, Games.get(id)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment