def spawn_apply
import bendvy-ecs-core@0.1.0.4/commands.bend as Commandsimport Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
37# Trusted deferred-command application: activate the reserved handle, then call
38# populate only on acceptance. Payload is consumed, including when activation
39# refuses; this low-level callback does not return an incoming-payload receipt.
40def spawn_apply(~S: Data,~C: Type,~R: Type,~E: Data,~P: Type,~populate: W.World<S,C,R,E> -> W.Handle<S> -> P -> W.World<S,C,R,E>,world: W.World<S,C,R,E>,+handle: W.Handle<S>,payload: P) -> W.World<S,C,R,E>:
41 spawned(~S,~C,~R,~E,~P,~populate,W.activate(~S,~C,~R,~E,world,handle),handle,payload)