From 7bd51538c8ecc49f1f00f554c3bab02cbb9d9849 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:45:18 -0500 Subject: [PATCH] add a synchronous example --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f32d044..8a58054 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,13 @@ const port = await connection.getInnerPort(); // ... transfer it to worker ... const client = new BareClient(port); ``` +```js +// doing this synchronously +const connection = new Ultraviolet.BareMuxConnection(); +let port; +connection.getInnerPort().then((MessagePort) => { + port = MessagePort; +}); +// ... transfer it to worker ... +this.bareClient = new BareClient(port) +``` \ No newline at end of file