sketch/lustre

Functions

pub fn compose(
  view: fn(a) -> Element(b),
  cache: Cache,
) -> fn(a) -> Element(b)

Wrap the view function in lustre. Be careful, on BEAM, sketch will add an additional div at the root of the HTML tree, to inject the styles in the app. This should have no impact on your app.

pub fn setup(options: Options) -> Result(Cache, SketchError)

setup is a shortcut for sketch.create_cache. It simplify usage for lustre.

pub fn ssr(el: Element(a), cache: Cache) -> Element(a)
Search Document