You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$('body').terminal(asyncfunction(command){constsignal=this.signal();constres=awaitfetch('./api?'+command,{ signal });if(!signal.aborted){constjson=awaitres.json();this.echo(json.result);}});
I have an idea for a new feature for jQuery Terminal
In this article are examples of using AbortController to cancel promises (by wrapping them and not resolving when there was an abort signal)
How To Cancel Any Async Task in JavaScript
This could be incorporated with the code for CTRL+D the old code with $.ajax can be removed, and replaced with handler for all promises.
The text was updated successfully, but these errors were encountered: