Skip to content

Commit

Permalink
fix: small memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
datsteves committed Jan 18, 2024
1 parent 041c38b commit 265748c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/actor/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export async function dispatch<T extends RecipientAsI, K extends keyof Recipient
let returnValue: undefined | Promise<Message<T[K]>>;
if (waitTillResponse) {
returnValue = new Promise((resolve) => {
actor.onMessage((msgs) => {
const unsub = actor.onMessage((msgs) => {
// TODO: just a workaround
const msg = msgs[0] as unknown as Message<T[K]>;
resolve(msg);
unsub();
});
});
}
Expand Down

0 comments on commit 265748c

Please sign in to comment.