We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
Good idea -- do you have any implementation ideas?
Sorry, something went wrong.
restart is easy to implement, we just need to replace the Iframe, but I'm not sure about my idea about pause/resume in browsers...
restart
console.log("Hello world") console.log("next line")
to:
let stopped = false; let pending; function stop() { stopped = true; } function resume() { stopped = false; pending.f(); pending.promise.resolve(); } function run(f) { const promise = createResolvable(); if (stopped) { pending = { promise, f }; } else { f(); promise.resolve(); } return promise; } (async () => { await run(() => console.log("Hello world"); await run(() => console.log("next line")); }) ();
Also we can do:
function run(code) { let pending; let paused = false; setTimeout(async () => { for (const f of code) { pending = createResolvable(); if (!paused) pending.resolve(); await pending(); f(); } }); return { pause() { if (paused) return; paused = true; }, resume() { paused = false; if (pending instanceof Promise) { pending.resolve(); } } } } const c = run( [ () => console.log("Hello world"), () => console.log("next line") ]); // c.pause() // c.resume()
Forget about that : ) We can do it very simple for now, maybe we can pause/resume at cell level.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: