Bundle / foldkit-bundle

The placed parts

Each placement exposes its parts in parent terms:

PartTypeBuilt from
placed.update(parent, message)Option<Update.Return>: None when the Message is not this placement'sUpdate.foldChildStep
placed.initUpdate.Step: writes the child's initial Model and lifts its CommandsUpdate.foldChildInit
placed.subscriptionsa Subscriptions record keyed Name@path/keySubscription.lift with a gate
placed.resourcesa Managed Resources record keyed Name@path/keyManagedResource.lift
placed.view(parent, h, viewInputs?)Html; nothing while the child is absenth.submodel
placed.viewIn(slot)the same view under another slot id, to render one placement in two positionsh.submodel
placed.helpers.name(...input)Update.Step for a programmatic entry pointUpdate.foldChildStep

Keys are prefixed with the placement, so two placements of one bundle never collide in Subscription.aggregate.

A placed view is drawn again only when its child's Model changes. A view drawn without inputs is given its Model alone, so while the parent holds the same child object the last drawing is handed back, and Foldkit neither runs the view nor diffs its tree: a Message for one placement leaves every other placement's drawing as it was. The child's Model changes identity exactly when its update changed it (a no-op returns the Model it was given). A view drawn with viewInputs, which a parent usually builds per render, is drawn every time, and so is every view while a server renders. A view that reads something outside its Model (a clock, a module's mutable state) opts out with memo: false in the placement config. A collection's items are kept the same way, each by its own Model.