Mix.Config 'config :appname, atom, value' info please

I came across a mix config with this line config :appname, atom, value. It was working so my assumption is a keyword list can be used in the above format instead of config :appname, key: value. Kindly educate me on the former syntax. I’ve also come across different uses cases of the keyword list, is there any resource that deals with it usage especially as function parameter.

:wave:

config :appname, atom, value is for config/3
config :appname, key: value is for config/2

2 Likes

I believe config/3 is meant to be use where the value is a keyword list; from the docs. Educate me on the below.

config :phoenix, :json_library, Jason
Why not config :phoenix, json_library: Jason

Why not config :phoenix, json_library: Jason

Stylistic choice, most likely. You can check that it would produce the same config with Application.get_all_env(:phoenix)

2 Likes