Prevent update when mouse is down

I would like to prevent plot updates when user is rotating/moving chart.
As you can see in example below, when updates are frequent and user drags slowly, the view is constantly being restored to the starting camera position.

Do you have some idea how to do this? I am using timer for plot updates and would love to have some way to know if the mouse button is being pressed at the time and return no_update in such a case.

Solved my problem. In case someone needed it, you basically need to add isMouseDown variable and constantly update it with 2 event listeners

Copying from https://stackoverflow.com/a/47930992/4601890:

let isMouseDown = false;

document.addEventListener('mousedown', function(event) {
    if ( event.which ) isMouseDown = true;
}, true);

document.addEventListener('mouseup', function(event) {
    if ( event.which ) isMouseDown = false;
}, true);

Then just not update if isMouseDown