Current section
Files
Jump to
Current section
Files
lib/create_structure/templates/config_holder.txt
defmodule {module_name}.Config.ConfigHolder do
use Agent
alias {module_name}.Config.AppConfig
@moduledoc """
Provides Behaviours for handle app-configs
"""
def start_link(%AppConfig{} = conf), do: Agent.start_link(fn -> conf end, name: __MODULE__)
def conf(), do: Agent.get(__MODULE__, & &1)
end