j-mendez/dfirestore

View on GitHub
worker.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { fireMethods } from "./actions.ts";

self.onmessage = async (e) => {
  const { pr, closeWorker } = e.data;

  await fireMethods.createDocument({
    id: undefined,
    value: pr,
    collection: "event_log",
  });

  // if message to worker === close
  if (closeWorker) {
    self.close();
  }
};