DenoDDeno
Powered by
SkepticMysticS
Denoβ€’2y agoβ€’
1 reply
SkepticMystic

How to only load worker once

I have a file that initialises a worker, and exports a function that posts a message to that worker. But if I import that function into multiple other files, the worker gets loaded each time. How can I prevent this to ensure only one instance of the worker is loaded, regardless of how many files I use the function in?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to load fonts in /static?
marvinh.Mmarvinh. / help
12mo ago