Site / Creating a site

Intents that wait for their owner

Some addresses ask something of a child that has no Model yet: a selection for a Builder whose page has not loaded, a preview asked for during the editor's load. The ask waits in the Model; a follow step applies it once the owner is ready, through the owner's own Messages, then lets it go so the address follows the owner again:

ts
const follow = followPending(EditorSlot, {
  pending: model => model.linked,
  release: model => ({ ...model, linked: Option.none() }),
  ready: (_child, model) => PageEditor.status(model) !== 'Loading',
  toMessages: (linked, _child, model) => [/* the ask in the owner's Messages */],
  send: (model, message) => Option.some(stepped(model, Message.GotEditorMessage({ message }))),
})

Apply the step outside whatever installs a loaded value (so the owner looks ready when read), and keep the pending ask where the address Subscription can rewrite it while it waits — or a reload during the load loses it. There is deliberately no target.intents carrier: URL↔intent mapping is app-shaped, and a carrier nothing reads would be dead API.