I've got a javascript loop that triggers every time the page receives an update via websocket. This loop persists usually even after the next websocket update is received. The result is multiple loops begin running and page performance degrades rapidly. Each loop is critical though and only becomes obsolete until the next update.
Is there a way to terminate an active loop from another function or am I plainly just thinking about this the wrong way?