Adds .onFrame() for handling calls on the next animation frame.