Skip to content

Commit

Permalink
Fix: browser runtime port transport send function
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniGuardiola committed Dec 20, 2023
1 parent 354c513 commit ca9c3b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-geese-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rpc-anywhere": patch
---

Fix: createTransportFromBrowserRuntimePort send function will actually send now.
2 changes: 1 addition & 1 deletion src/transports/browser-runtime-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function createTransportFromBrowserRuntimePort(
let transportHandler: ((message: any, port: Port) => void) | undefined;
return {
send(data) {
port.postMessage.bind(rpcTransportMessageOut(data, { transportId }));
port.postMessage(rpcTransportMessageOut(data, { transportId }));
},
registerHandler(handler) {
transportHandler = (message, port) => {
Expand Down

0 comments on commit ca9c3b6

Please sign in to comment.