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

Link to this function

assign_list(socket, arg)

View Source

Specs

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

Returns container phx-update attribute string based on the type of list update.

Specs

Returns the sort instruction string (or nil if sorting not required).