Bundle / foldkit-bundle
foldkit-bundle
Packages a Foldkit child machine, a Submodel, once, and places it anywhere in a parent, without adding a store, a reducer, or a runtime.
A Submodel in Foldkit is wired by hand in five places: the update fold, the init, the Subscription lift, the Managed Resource lift, and the view. Placing the same child twice repeats all five. A Bundle holds the child's parts in one value, and a Link says where it lives. Placing it compiles each part to the Foldkit lift that already exists for it.
Bundle (what: Model, Message, init, update, subscriptions, resources, view, helpers)
+
Link (where: a lens onto the child Model, and the parent Message variant)
=
Placed (the same parts, lifted into the parent)A placement is still an ordinary Submodel. The child's state is a field of the
parent Model, its Messages are a variant of the parent Message, and every
transition goes through the parent's update. Replay, DevTools, and Scene tests
see exactly what they saw before.