Skip to content

Commit

Permalink
feat(service-worker): support pick a client as worker sender
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Jul 2, 2023
1 parent c6aa81a commit 5164337
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/transports/serviceWorkerTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ export abstract class ServiceWorkerServiceTransport<
return;
}

// TODO: select a client for sender.
const client = message._extra?._client;
if (client) {
delete message._extra!._client;
client.postMessage(data, transfer);
return;
}
self.clients
.matchAll()
.then((all) =>
Expand Down

0 comments on commit 5164337

Please sign in to comment.