View Source AshPyroComponents.Components.Page (AshPyroComponents v0.0.1)
Auto-render a full-featured page for a given resource.
Summary
Functions
Build a page automatically from AshPyro's live_view
DSL. It will provide a complete page with all the usual features
Get the timezone from session or connect_params, defaulting to the local timezone.
Update the :now
assign taking the timezone into account.
Functions
Build a page automatically from AshPyro's live_view
DSL. It will provide a complete page with all the usual features:
- url-based state
- pagination
- sorting
- filtering
- realtime updates via pub-sub
- forms
- authorization
- formatting date/time to user's timezone
- routes to include in your
router.ex
. 🚀
defmodule ExampleWeb.Vendor.CompanyLive do
use ExampleWeb, :live_view
use AshPyroComponents.Components.Page,
resource: Example.Vendor.Company,
page: :companies
end
@spec get_live_tz(Phoenix.LiveView.Socket.t(), any()) :: any()
Get the timezone from session or connect_params, defaulting to the local timezone.
@spec handle_tick(Phoenix.LiveView.Socket.t()) :: Phoenix.LiveView.Socket.t()
Update the :now
assign taking the timezone into account.