you're capturing the value in a lambda, which can ...
# compose
r
you're capturing the value in a lambda, which can get stale - read it directly from the ambient where you're using it - i.e., change
RouterSwitchChildren(history)
to
RouterSwitchChildren(+ambient(CurrentHistory))