Home / File/ my-shared-worker.ts — vite Source File

my-shared-worker.ts — vite Source File

Architecture documentation for my-shared-worker.ts, a typescript file in the vite codebase.

Entity Profile

Relationship Graph

Source Code

let sharedWorkerCount = 0

// @ts-expect-error onconnect exists in worker
self.onconnect = (event) => {
  sharedWorkerCount++
  const port = event.ports[0]
  if (sharedWorkerCount >= 2) {
    port.postMessage('pong')
  }
}

// for sourcemap
console.log('my-shared-worker.js')

Domain

Subdomains

Functions

Frequently Asked Questions

What does my-shared-worker.ts do?
my-shared-worker.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in my-shared-worker.ts?
my-shared-worker.ts defines 1 function(s): self.
Where is my-shared-worker.ts in the architecture?
my-shared-worker.ts is located at playground/worker/my-shared-worker.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/worker).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free