SSR / foldkit-ssr/binder

Binder

namespace · packages/ssr/src/binder.ts:683

const Binder = { start, canAnswerLocally, applyAnchors }

In the guides

Members

Binder.start

function · packages/ssr/src/binder.ts:289

start<Model, Tag extends string = string, Keys extends string = string>(
  options: BinderOptions<Model, Tag, Keys>,
): BinderHandle<Model>

Start the delegated binder on a server-drawn page.

Answers declared Messages with no emitted record whose written paths are all bound, writing anchored elements directly. Invalid payloads are dropped and reported without waking the runtime. Any undeclared Message, or any Message that emits a Command or writes an unbound path, triggers wake() and is queued once for the runtime to replay on hand-over.

Binder.canAnswerLocally

function · packages/ssr/src/binder.ts:192

canAnswerLocally<Model, Keys extends string>(
  transition: BinderTransitionLike<Model>,
  bindings: Bindings<Model, Keys>,
): boolean

Whether every path transition writes is covered by at least one bound anchor's reads.

Binder.applyAnchors

function · packages/ssr/src/binder.ts:210

applyAnchors<Keys extends string>(
  root: Element,
  values: Readonly<Record<Keys, BindingValue>>,
): void

Write evaluated binding values to anchored elements under root (text only, never HTML).