Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 9b0e8a2

Browse files
committed
types(pipeline): Tidy types.
1 parent 86fcb83 commit 9b0e8a2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/utils/iterators.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,12 @@ const endGeneratorTimeout = pMemoize(async (gtr, error, timeout = 250) => {
140140

141141
/**
142142
* Creates a generator that can be cancelled and perform optional final cleanup.
143-
* const [cancal, generator] = CancelableGenerator(iterable, onFinally)
143+
* const generator = CancelableGenerator(iterable, onFinally)
144144
*/
145145

146-
export function CancelableGenerator(iterable, onFinally = () => {}, { timeout = 250 } = {}) {
147-
let started = false
146+
export function CancelableGenerator(iterable, onFinally = async () => {}, { timeout = 250 } = {}) {
148147
let cancelled = false
149148
let finalCalled = false
150-
let pendingNextCount = 0
151149
let error
152150

153151
const cancelSignal = new Emitter()
@@ -201,8 +199,6 @@ export function CancelableGenerator(iterable, onFinally = () => {}, { timeout =
201199
}
202200

203201
async function* CancelableGeneratorFn() {
204-
started = true
205-
206202
// manually iterate
207203
iterator = iterable[Symbol.asyncIterator]()
208204

0 commit comments

Comments
 (0)