internal/props

Types

pub type PageObject {
  PageObject(
    component: String,
    url: String,
    props: List(PageProp),
    errors: List(PageProp),
    defers: List(PageProp),
    shared: List(PageProp),
    version: String,
    clear_history: option.Option(Bool),
  )
}

Constructors

pub type PageProp {
  ErrorProp(name: String, value: json.Json)
  BaseProp(name: String, value: json.Json)
  OnceProp(name: String, value: fn() -> json.Json)
  MergeProp(name: String, value: fn() -> json.Json)
  SharedProp(name: String, value: json.Json)
  DeferProp(
    name: String,
    value: fn() -> Result(json.Json, Nil),
    group: option.Option(String),
  )
}

Constructors

pub type RenderContext {
  RenderContext(
    component: String,
    version: String,
    first_load: Bool,
    reset: List(String),
    partials: List(String),
    excepts: List(String),
  )
}

Constructors

  • RenderContext(
      component: String,
      version: String,
      first_load: Bool,
      reset: List(String),
      partials: List(String),
      excepts: List(String),
    )

Values

pub fn dict_to_prop(
  d: dict.Dict(String, String),
) -> List(PageProp)
pub fn page_object_to_json(
  po: PageObject,
  ctx: RenderContext,
) -> json.Json
Search Document