freedive/lib/freedive_web/live/liliform_live.ex

17 lines
430 B
Elixir
Raw Normal View History

defmodule FreediveWeb.LiliformLive do
defmacro __using__(opts) do
quote location: :keep, bind_quoted: [opts: opts] do
2024-05-15 22:18:55 +02:00
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
2024-05-15 22:18:55 +02:00
end
end
@callback items() :: [map]
end