def apply
bendvy-ecs-core@0.1.0.3 · execution_machine_state.bend:70
import bendvy-ecs-core@0.1.0.3/execution_machine_state.bend as ExecutionMachineState
import Base
import bendvy-ecs-core@0.1.0.3/machine.bend as M
import bendvy-ecs-core@0.1.0.3/change_tick.bend as Tick
70def apply(~S:Data,~K:Data,~V:Data,~same:V -> V -> Bool,cell:Cell<S,K,V>,tick:Tick.Tick) -> Cell<S,K,V>:
71 match cell:
72 case Cell{M.Present{+current,M.Queued{+value,skipSame},_,_},stream,revision,stamp,nextStamp,sequence,_,namespace,_}:committed(~S,~K,~V,current,value,skipSame,stream,revision,stamp,sequence,tick,same(current,value),namespace)
73 case Cell{slot,stream,revision,stamp,nextStamp,sequence,True{},namespace,intent}:Cell{slot,stream,revision,stamp,nextStamp,sequence,False{},namespace,intent}
74 case Cell{slot,stream,revision,stamp,nextStamp,sequence,False{},namespace,_}:Cell{M.clear_changed(~S,~K,~V,slot),stream,revision,stamp,nextStamp,sequence,False{},namespace,Idle{}}