Skip to content

Instantly share code, notes, and snippets.

@wess
Last active January 21, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wess/917d0142b3c6079abb82327d251a71c7 to your computer and use it in GitHub Desktop.
Save wess/917d0142b3c6079abb82327d251a71c7 to your computer and use it in GitHub Desktop.
def handle_call({:put, key, value}, _from, state) do
{:reply, :ok, Map.put(state, key, value)}
end
def handle_call({:get, key, value}, _from, state) do
{:reply, :ok, Map.get(state, key, value)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment