David Dal Busco
Feb 23, 2023

--

Your approach sounds pretty cool! I never tried but if you ultimately implement it, I would like to see the resulting code.

In comparison to my blog post, what I now generally do, is obfuscating the web worker interactions within a service function. That way my components just know about the functions that are exposed and know nothing about postMessage in and out.

e.g. this worker I use to synchronize the authentication in my project Juno

https://github.com/buildwithjuno/juno/blob/6e7453dba15d578a8dd5f3b3315d8d82e4b63fb1/src/frontend/src/lib/services/worker.auth.services.ts#L5

Thanks for the feedback Ray!

--

--

David Dal Busco
David Dal Busco

Written by David Dal Busco

Freelancer by day | Creator of Juno.build by night

Responses (1)