Fix some missing double quotes in Agent section (#2682)

This commit is contained in:
Jonah Hirsch 2017-03-15 02:06:31 -07:00 committed by ven
parent 56275f78b2
commit 2b4fe43f71

View File

@ -433,11 +433,11 @@ self() #=> #PID<0.27.0>
# Create an agent with `Agent.start_link`, passing in a function # Create an agent with `Agent.start_link`, passing in a function
# The initial state of the agent will be whatever that function returns # The initial state of the agent will be whatever that function returns
{ok, my_agent} = Agent.start_link(fn -> ["red, green"] end) {ok, my_agent} = Agent.start_link(fn -> ["red", "green"] end)
# `Agent.get` takes an agent name and a `fn` that gets passed the current state # `Agent.get` takes an agent name and a `fn` that gets passed the current state
# Whatever that `fn` returns is what you'll get back # Whatever that `fn` returns is what you'll get back
Agent.get(my_agent, fn colors -> colors end) #=> ["red, "green"] Agent.get(my_agent, fn colors -> colors end) #=> ["red", "green"]
# Update the agent's state the same way # Update the agent's state the same way
Agent.update(my_agent, fn colors -> ["blue" | colors] end) Agent.update(my_agent, fn colors -> ["blue" | colors] end)