What are the specific steps to add a SharedWorker
to an @angular/cli >1.2
-generated project. I would like the SharedWorker to be defined in TypeScript (with full/correct type-definitions editor support), to share interfaces with the main project, and to be continuously compiled and tested along with the main project.
I haven't discovered an example or blog post that describes how to modify a cli-generated project to include either a Worker
or a SharedWorker
. However, there are several posts (such as this one) which show how to transform an entire cli-generated project to run it as a web worker. But that's not my use-case.
I want to confine interaction with a Lovefield database to a SharedWorker
that runs in a separate process from the main application.
Though I've experimented a bit attempting to figure this out, I haven't made much progress. Hopefully someone can save me (and future readers) a lot of time.