Closed mcintyre94 closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/sliphq/run-wasm/DAWdstbEt73rW28tgtQYZPRpwZVu
✅ Preview: https://run-wasm-git-fork-mcintyre94-load-ts-once-sliphq.vercel.app
This PR refactors the /ts page so that it only calls
createTSClient
once, in the same way as the Python ones. This means that when we add preloading of libs (see #79), that code will be run only once - before any user-entered code is run.Note that I've put this into a
useEffect
even though it's synchronous, because we'll need this structure once we do want to call an asynchronous preload function. I've commented out an example of how this would look.