glendix/lustre
Adapts Lustre applications and effects to the Mendix widget runtime.
Values
pub fn embed(
element element: redraw.Element,
) -> element.Element(msg)
Embeds a Lustre component in a Mendix widget element.
pub fn keyed_host(
key key: String,
props props: properties,
render render: fn(properties) -> redraw.Element,
) -> redraw.Element
Renders an application inside a keyed React host.
The render callback receives fresh props on every parent render. React preserves the hosted application while the key is unchanged and remounts it when the key changes. Derive the key from application state; Glendix does not interpret Mendix datasource or widget props.
pub fn render(
element element: element.Element(msg),
dispatch dispatch: fn(msg) -> Nil,
) -> redraw.Element
Renders a Lustre application as a Mendix widget element.
pub fn use_simple(
init init: model,
update update: fn(model, msg) -> model,
view view: fn(model) -> element.Element(msg),
) -> redraw.Element
Starts a simple Lustre component inside a Mendix widget.
pub fn use_tea(
init init: #(model, effect.Effect(msg)),
update update: fn(model, msg) -> #(model, effect.Effect(msg)),
view view: fn(model) -> element.Element(msg),
) -> redraw.Element
Starts a Lustre TEA application inside a Mendix widget.