View Source Loupe.PhoenixLiveView.Renderer behaviour (Loupe v0.9.0)

Module that is meant to be implemented to control how the component renders

Link to this section Summary

Functions

Determines how a value should be rendered for given renderer module

Gets a structure's link for a given renderer module

Link to this section Types

Link to this section Callbacks

Link to this callback

render_type(any, assigns)

View Source
@callback render_type(any(), Loupe.Ecto.Context.assigns()) :: :ignore | {:ok, any()}
Link to this callback

struct_link(struct, atom, assigns)

View Source
@callback struct_link(struct(), atom(), Loupe.Ecto.Context.assigns()) ::
  String.t() | {String.t(), Keyword.t()} | nil

Link to this section Functions

Link to this function

render_type(module, value, assigns)

View Source
@spec render_type(t() | nil, any(), Loupe.Ecto.Context.assigns()) :: any()

Determines how a value should be rendered for given renderer module

Link to this function

struct_link(module, struct, key, assigns)

View Source
@spec struct_link(t() | nil, struct(), atom(), Loupe.Ecto.Context.assigns()) ::
  String.t() | {String.t(), Keyword.t()} | nil

Gets a structure's link for a given renderer module