illustrious/client

Types

The options necessary to initialize the client-side lustre app

pub type ClientAppBuilder(context, model, action) {
  ClientAppBuilder(
    view: illustrious.View(model, action),
    default_model: model,
    updater: state.Updater(model, action),
    decoder: state.Decoder(action),
  )
}

Constructors

  • ClientAppBuilder(
      view: illustrious.View(model, action),
      default_model: model,
      updater: state.Updater(model, action),
      decoder: state.Decoder(action),
    )

    Arguments

    • view

      The function which takes in the application from the path and model, and renders the application

    • default_model

      The initial application state before any baked data is processed

    • updater

      The function used to update application state based on the previous model and an action being performed

    • decoder

      The function which transforms a JSON payload (in the form of initializer data or page loader data)

Functions

pub fn back() -> IllustriousAction(a)

Used to pop the latest route off the browser’s history stack (equivalent to hitting the back button in the browser).

pub fn build_app(
  builder: ClientAppBuilder(a, b, c),
) -> App(d, IllustriousModel(b), IllustriousAction(c))

Initializes the client-side lustre app in the browser

pub fn forward() -> IllustriousAction(a)

Used to push the next route back onto the browser’s history stack (equivalent to hitting the forward button in the browser).

pub fn go_to(route: String) -> IllustriousAction(a)

Used to push a new route into the browser’s history stack.

pub fn perform(action: a) -> IllustriousAction(a)

Used to dispatch an action to your own internal state.

pub fn redirect(route: String) -> IllustriousAction(a)

Used to replace the current route in the browser’s history.

Search Document