Skip to content

Instantly share code, notes, and snippets.

@aharpole
Created March 9, 2019 00:06
Show Gist options
  • Save aharpole/16ea1d16ffabac72198b2c317e611b83 to your computer and use it in GitHub Desktop.
Save aharpole/16ea1d16ffabac72198b2c317e611b83 to your computer and use it in GitHub Desktop.
new handle cast
def handle_cast(:increment, state) do
new_state = Map.put(state, :value, &(&1 + state.increment_by))
{:noreply, state}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment