Closed keystroke closed 2 years ago
I added this so I could run the notebooks in Deno
I’d prefer to use setImmediate if available, but if neither requestAnimationFrame nor setImmediate are available, we can fallback again to setTimeout.
Fixed in c439e62bb8922fbab6ba2ecc4b4f245d72fc7bfa. Thanks for the suggestion.
@mbostock Thanks for the quick reply and addition! I am using this with a Netlify edge service I built (https://obs.run) to provide auto-generated wrapper scripts for executing ObservableHQ notebooks in Deno: https://observablehq.com/@keystroke/obs-run
When running in Deno, I need to execute notebooks like this:
This requires me to set a mock / pollyfill of the setImmediate function, and then use a dynamic import for the runtime module. setTimeout should serve the same purpose and work in a wider variety of environments.