lustre

To read the full documentation for this module, please visit https://lustre.build/api/lustre

Types

pub opaque type App(flags, model, msg)
pub type Error {
  AppAlreadyStarted
  AppNotYetStarted
  BadComponentName
  ComponentAlreadyRegistered
  ElementNotFound
  NotABrowser
}

Constructors

  • AppAlreadyStarted
  • AppNotYetStarted
  • BadComponentName
  • ComponentAlreadyRegistered
  • ElementNotFound
  • NotABrowser

Functions

pub fn application(_init: fn(a) -> #(b, Effect(c)), _update: fn(
    b,
    c,
  ) -> #(b, Effect(c)), _view: fn(b) -> Element(c)) -> App(
  a,
  b,
  c,
)
pub fn component(_name: String, _init: fn() -> #(a, Effect(b)), _update: fn(
    a,
    b,
  ) -> #(a, Effect(b)), _view: fn(a) -> Element(b), _on_attribute_change: Map(
    String,
    fn(Dynamic) -> Result(b, List(DecodeError)),
  )) -> Result(Nil, Error)
pub fn destroy(_app: App(a, b, c)) -> Result(Nil, Error)
pub fn element(element: Element(a)) -> App(Nil, Nil, a)
pub fn is_browser() -> Bool
pub fn is_registered(_name: String) -> Bool
pub fn simple(init: fn(a) -> b, update: fn(b, c) -> b, view: fn(b) ->
    Element(c)) -> App(a, b, c)
pub fn start(_app: App(a, b, c), _selector: String, _flags: a) -> Result(
  fn(c) -> Nil,
  Error,
)
Search Document