batch events and invoke them during the animation frame, see #5