PhoenixLiveViewExt.Listilled.Helpers (phoenix_live_view_ext v1.2.2) View Source
Provides helper functions intended for use in LiveView and LiveComponent templates relying on Listilled assign lists.
Link to this section Summary
Functions
Assigns the listilled list assigns, list update and state version to the socket.
Returns container phx-update
attribute string based on the type of list update.
Returns the sort instruction string (or nil if sorting not required).
Link to this section Types
Specs
listilled() :: module()
Link to this section Functions
Specs
assign_list( Phoenix.LiveView.Socket.t(), {[PhoenixLiveViewExt.Listilled.assigns()], PhoenixLiveViewExt.Listiller.list_meta()} ) :: Phoenix.LiveView.Socket.t()
Assigns the listilled list assigns, list update and state version to the socket.
Uses the listilled name (a value return by Listilled.component_name/0 if defined, otherwise the last name of the module with the truncated "Component" suffix if any) and appends the following to form the atom keys:
- <component_name>_list_assigns
- <component_name>_list_update
- <component_name>_list_version
Specs
phx_update(PhoenixLiveViewExt.Listiller.list_update()) :: String.t()
Returns container phx-update
attribute string based on the type of list update.
Specs
updated_sort(PhoenixLiveViewExt.Listilled.updated()) :: String.t()
Returns the sort instruction string (or nil if sorting not required).