From f4e7930f82eea9ee88f9f8fbaf52dae9b61f67b0 Mon Sep 17 00:00:00 2001
From: Jono Wenger <jono@elixxir.io>
Date: Mon, 9 Jan 2023 10:53:56 -0800
Subject: [PATCH] Add build directive

---
 indexedDbWorker/worker.go      | 8 ++++++++
 indexedDbWorker/worker_test.go | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/indexedDbWorker/worker.go b/indexedDbWorker/worker.go
index 69b7d935..ebd4e4ec 100644
--- a/indexedDbWorker/worker.go
+++ b/indexedDbWorker/worker.go
@@ -275,6 +275,14 @@ func (wh *WorkerHandler) postMessage(msg any) {
 	wh.worker.Call("postMessage", msg)
 }
 
+// Terminate immediately terminates the Worker. This does not offer the worker
+// an opportunity to finish its operations; it is stopped at once.
+//
+// Doc: https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate
+func (wh *WorkerHandler) Terminate() {
+	wh.worker.Call("terminate")
+}
+
 // newWorkerOptions creates a new Javascript object containing optional
 // properties that can be set when creating a new worker.
 //
diff --git a/indexedDbWorker/worker_test.go b/indexedDbWorker/worker_test.go
index da36e795..1c2e09a5 100644
--- a/indexedDbWorker/worker_test.go
+++ b/indexedDbWorker/worker_test.go
@@ -5,6 +5,8 @@
 // LICENSE file.                                                              //
 ////////////////////////////////////////////////////////////////////////////////
 
+//go:build js && wasm
+
 package indexedDbWorker
 
 import (
-- 
GitLab