Fix formatting
This commit is contained in:
@@ -35,7 +35,7 @@ export class AsyncPushIterator<T> {
|
|||||||
// `start`'s `this` is the underlying source object when using a plain method.
|
// `start`'s `this` is the underlying source object when using a plain method.
|
||||||
// An arrow function captures the class instance so the controller is stored here.
|
// An arrow function captures the class instance so the controller is stored here.
|
||||||
this.stream = new ReadableStream({
|
this.stream = new ReadableStream({
|
||||||
start: (controller: ReadableStreamDefaultController<T>) => {
|
start: (controller: ReadableStreamDefaultController<T>): void => {
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -76,7 +76,7 @@ export class AsyncPushIterator<T> {
|
|||||||
* Uses `preventCancel: true` so early `break` from `for await...of` does not
|
* Uses `preventCancel: true` so early `break` from `for await...of` does not
|
||||||
* close the stream and block later pushes.
|
* close the stream and block later pushes.
|
||||||
*/
|
*/
|
||||||
[Symbol.asyncIterator]() {
|
[Symbol.asyncIterator](): AsyncIterableIterator<T> {
|
||||||
return this.stream.values({ preventCancel: true });
|
return this.stream.values({ preventCancel: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const testPushComposedPushAndConsume = async (): Promise<void> => {
|
|||||||
const iterator = new AsyncPushIterator<number>();
|
const iterator = new AsyncPushIterator<number>();
|
||||||
|
|
||||||
const result = new Promise<number[]>((resolve) => {
|
const result = new Promise<number[]>((resolve) => {
|
||||||
void (async () => {
|
void (async (): Promise<void> => {
|
||||||
resolve(await collectAll(iterator));
|
resolve(await collectAll(iterator));
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
@@ -62,7 +62,7 @@ const testPushComposedResolvesWithNoValues = async (): Promise<void> => {
|
|||||||
const iterator = new AsyncPushIterator<number>();
|
const iterator = new AsyncPushIterator<number>();
|
||||||
|
|
||||||
const result = new Promise<number[]>((resolve) => {
|
const result = new Promise<number[]>((resolve) => {
|
||||||
void (async () => {
|
void (async (): Promise<void> => {
|
||||||
resolve(await collectAll(iterator));
|
resolve(await collectAll(iterator));
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
@@ -79,7 +79,7 @@ const testPushComposedIgnoresValuesAfterClose = async (): Promise<void> => {
|
|||||||
const iterator = new AsyncPushIterator<number>();
|
const iterator = new AsyncPushIterator<number>();
|
||||||
|
|
||||||
const result = new Promise<number[]>((resolve) => {
|
const result = new Promise<number[]>((resolve) => {
|
||||||
void (async () => {
|
void (async (): Promise<void> => {
|
||||||
resolve(await collectAll(iterator));
|
resolve(await collectAll(iterator));
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
@@ -106,14 +106,14 @@ const testPushComposedRejectsMultipleConsumers = async (): Promise<void> => {
|
|||||||
|
|
||||||
const successfulIterator = (): Promise<number[]> =>
|
const successfulIterator = (): Promise<number[]> =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
void (async () => {
|
void (async (): Promise<void> => {
|
||||||
resolve(await collectAll(iterator));
|
resolve(await collectAll(iterator));
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
|
|
||||||
const failedIterator = (): Promise<void> =>
|
const failedIterator = (): Promise<void> =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
void (async () => {
|
void (async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
/* eslint-disable-next-line */
|
/* eslint-disable-next-line */
|
||||||
for await (const _value of iterator) {
|
for await (const _value of iterator) {
|
||||||
|
|||||||
Reference in New Issue
Block a user