CRUD / foldkit-mixins-crud

Loading

namespace · packages/mixins-crud/src/index.ts:184

const Loading = { view, shown }

What a read says before it has an answer, wherever rows or a value are not the thing to draw. Each draws one paragraph on the application's own status slot: the words are the caller's, the role and aria-busy are not negotiable. ListView and DetailView draw these for their own states.

In the guides

Members

Loading.view

function · packages/mixins-crud/src/index.ts:186

view<Message>(
  status: SlotView.SlotBuilder<Message>,
  h: HtmlBuilder<Message>,
  text: string,
): Html

Busy while the first answer is awaited, so loading is told from empty.

Loading.shown

const · packages/mixins-crud/src/index.ts:200

shown: StyleValue

Busy text said only once the wait is noticeable: a read that answers quickly shows nothing, where a "Loading…" drawn for a frame read as a flash. Attach it to the status slot. The paragraph itself always renders, so its space is held from the start and nothing moves when the text shows; answering in time removes aria-busy before the delay ends, so the text never appears. No spinner art: the text and this delayed fade are the whole convention.