lightspeed/component/story

Story helpers for function-component template fixtures.

Types

One deterministic template story fixture.

pub type Story(assigns, slots) {
  Story(
    name: String,
    component: fn(assigns, slots) -> component.Rendered,
    assigns: assigns,
    slots: slots,
  )
}

Constructors

  • Story(
      name: String,
      component: fn(assigns, slots) -> component.Rendered,
      assigns: assigns,
      slots: slots,
    )

Values

pub fn name(story: Story(assigns, slots)) -> String

Story name.

pub fn render(story: Story(assigns, slots)) -> component.Rendered

Render story output.

pub fn story(
  name: String,
  component: fn(assigns, slots) -> component.Rendered,
  assigns: assigns,
  slots: slots,
) -> Story(assigns, slots)

Build one story.

Search Document