Forgot to add CounterAgent

parent 7b53806b
defmodule Grains.CounterAgent do
def start_link() do
Agent.start_link(fn -> 0 end, name: __MODULE__)
end
def click() do
Agent.get_and_update(__MODULE__, fn(n) -> {n + 1, n + 1} end)
end
def set(new_value) do
Agent.update(__MODULE__, fn(_n) -> new_value end)
end
def get() do
Agent.get(__MODULE__, fn(n) -> n end)
end
end
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.88",
version: "0.0.89",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment