illustrious
Illustrious is a meta framework built on top of lustre. It supports:
- server-side rendering
- turning into a SPA by using client-side routing after initial load
- automatic data hydration when a page is first loaded & on navigation
Types
The decoder function which takes in a JSON-decoded dynamic from the initializer or server loader and returns an effect which can be executed in order to populate the application state before rendering
pub type Decoder(action) =
fn(Dynamic) -> Effect(IllustriousAction(action))
The path portion of a URL, split by each directory separator (/
)
pub type Path =
state.Path
The router function takes in the split path & the app state and returns the actual elements to render, or None if there is nothing to render (404)
pub type Router(state, action) =
fn(Path, state) -> Option(Element(IllustriousAction(action)))
The updater function takes in the current application state and an action
and returns the new application state and an effect (possibly the none
effect) which get executed
pub type Updater(state, action) =
fn(state, action) ->
#(state, Effect(IllustriousAction(action)))