Stateful.sync
function · packages/composition/src/foldkit/index.ts:553
sync<Parent, ParentMessage, R, Model, B extends AnyBlock>(
collection: StatefulCollection<Parent, ParentMessage, R, Model>,
catalog: Catalog,
block: B,
pages: {
readonly before: Document | undefined
readonly after: Document
},
prepare: (model: Model, props: PropsOf<B>) => Model,
): Update.Step<Parent, ParentMessage, R>The Step that keeps collection in step with a page's nodes of block,
from the page it showed (before, undefined at first) to the one it
shows now: a new node is added, its Model prepared from its props, a gone
one removed, and one whose props changed started again with the new ones.