def despawn_apply_with
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
122# Trusted schema-cleanup command: after accepted deactivation, clear the component
123# store and release the cleared slot. Rejected deactivation skips clear. The clear
124# adapter consumes actual payloads; this is not a recovery receipt.
125def despawn_apply_with(~S: Data,~C: Type,~R: Type,~E: Data,~clear: C -> W.Handle<S> -> C,world: W.World<S,C,R,E>,+handle: W.Handle<S>) -> W.World<S,C,R,E>:
126 clear_accepted(~S,~C,~R,~E,~clear,W.deactivate(~S,~C,~R,~E,world,handle),handle)