Skip to content

Add WorkerOptions to [Shared]Worker constructors #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use overload for Worker constructor
  • Loading branch information
armanbilge committed Apr 7, 2022
commit a9ab55f9d2fa3ae94f14fabe0963ce77d76c6aa3
4 changes: 3 additions & 1 deletion dom/src/main/scala/org/scalajs/dom/Worker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import scala.scalajs.js.annotation._
*/
@js.native
@JSGlobal
class Worker(scriptURL: String, options: js.UndefOr[WorkerOptions] = js.native) extends AbstractWorker {
class Worker(scriptURL: String, options: WorkerOptions) extends AbstractWorker {

def this(scriptURL: String) = this(scriptURL, js.native)

/** The Worker.onmessage property represents an EventHandler, that is a function to be called when the message event
* occurs. These events are of type MessageEvent and will be called when the worker calls its own postMessage()
Expand Down