preactjs / preact-www

:book: Preact documentation website.
https://preactjs.com
MIT License
359 stars 506 forks source link

refactor: Only debounce REPL runner on user input #1160

Closed rschristian closed 5 months ago

rschristian commented 5 months ago

Closes #1159

Instead of debouncing the REPL runner by 500ms across the board, limit it to user interaction. This lets us switch examples in the REPL or pages in the tutorial faster -- the former is especially relevant, as dynamically pulling modules from esm.sh means there often will be a delay anyhow. Decreasing the baseline delay is therefore quite useful to make the editor seem faster & more fluid.