Skip to content

Commit

Permalink
fix(signal): promise to multi requests works
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Mar 12, 2022
1 parent c16328b commit dd59f0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/signal/src/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ export class SignalInterface<SignalName extends keyof AlwatrSignals> {
*/
request(requestParam: AlwatrRequestSignals[SignalName]): Promise<AlwatrSignals[SignalName]> {
this._logger.logMethodArgs('request', {requestParam});
const nextSignalValuePromise = this.getNextSignalValue();
_dispatchSignal(
`request-${this.name}` as unknown as SignalName,
requestParam as unknown as AlwatrSignals[SignalName], // mastmalize to avoid type error
);
return this.getNextSignalValue();
return nextSignalValuePromise;
}

/**
Expand Down

0 comments on commit dd59f0e

Please sign in to comment.