Skip to content

Commit

Permalink
feat: SignalStream: PromiseLike<boolean> -> PromiseLike<void>
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Jan 24, 2020
1 parent dc98569 commit 87112aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/js/signals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const signals = {

/** SignalStream represents the stream of signals, implements both
* AsyncIterator and PromiseLike */
export class SignalStream implements AsyncIterator<void>, PromiseLike<boolean> {
export class SignalStream implements AsyncIterator<void>, PromiseLike<void> {
private rid: number;
/** The promise of polling the signal,
* resolves with false when it receives signal,
Expand Down Expand Up @@ -124,10 +124,10 @@ export class SignalStream implements AsyncIterator<void>, PromiseLike<boolean> {
}

then<T, S>(
f: (v: boolean) => T | Promise<T>,
f: (v: void) => T | Promise<T>,
g?: (v: Error) => S | Promise<S>
): Promise<T | S> {
return this.pollingPromise.then(f, g);
return this.pollingPromise.then((_): void => {}).then(f, g);
}

async next(): Promise<IteratorResult<void>> {
Expand Down

0 comments on commit 87112aa

Please sign in to comment.