freedive/lib/freedive_web/live/liliform_live.ex

16 lines
430 B
Elixir

defmodule FreediveWeb.LiliformLive do
defmacro __using__(opts) do
quote location: :keep, bind_quoted: [opts: opts] do
use FreediveWeb, :live_view
@behaviour FreediveWeb.LiliformLive
def mount(_params, _session, socket) do
socket = assign(socket, :opts, unquote(opts))
socket = assign(socket, :items, items())
{:ok, socket}
end
end
end
@callback items() :: [map]
end