In src/internal/scheduler.js, flush() protects against recursion caused by afterUpdate with its seen_callbacks variable.
This may lead to surprising behaviour, if the user depends on multiple but finite invocations of their afterUpdate callback, so it should be documented.