Packages

A template for building Elixir components (projects that hold state). This project is an extremely paired down version of `mix new «project_name» --sup` based on Dave Thomas' view of simplifying our Elixir code. Let's see how this plays out.

Current section

Files

Jump to
gen_template_component template $PROJECT_NAME$ lib $PROJECT_NAME$.ex
Raw

template/$PROJECT_NAME$/lib/$PROJECT_NAME$.ex

defmodule <%= @project_name_camel_case %> do
# See http://elixir-lang.org/docs/stable/elixir/Application.html
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
# worker(One.Worker, [arg1, arg2, arg3]),
]
opts = [
strategy: :one_for_one,
name: <%= @project_name_camel_case %>.Supervisor
]
Supervisor.start_link(children, opts)
end
end