Clear setInterval somehow

Issue #22 new
Michael P repo owner created an issue

Have no idea how

Comments (3)

  1. neander-squirrel
    // store your interval in a variable...
    var myInterval = setInterval(task, 1000)
    
    // ...so you can clear it any time:
    clearInterval(myInterval)
    
  2. neander-squirrel

    Actually there is a bug in JSRun. Reproduce: If you set an interval and did not clear it before clicked on options/new to create a new project, the previously started setInterval will keep running.

    There is no way to stop it as the reference is not in the new, empty file.

    Force stopping the app and also toggle theme or font will clear the setInterval.

    Lol, I thought this is a simple JavaScript newbie question... Now I see who's asking ':D

  3. Michael P reporter

    The question was actually how it could be cleared - I hope on new program run. Have no idea how users expect it should be cleared. Toggling theme or font will produce recreating of web view - that's why it helps

  4. Log in to comment