A pausable computation that ultimately produces a value of type T.
An item of this type can be used to either create a job of type T, or awaited
in a job via yield * to obtain the value.
Any generator function that ultimately returns a value, implicitly returns a
Yielding of that type, but it's best to explicitly declare this so that
TypeScript can properly type check your yield expressions. (e.g. function *(): Yielding<number> {} for a generator function that ultimately returns a
number.)
Generator functions implementing this type should only ever yield * to
things that are of Yielding type, such as a Job, to() or
other generators declared Yielding.
A pausable computation that ultimately produces a value of type T.
An item of this type can be used to either create a job of type T, or awaited in a job via
yield *
to obtain the value.Any generator function that ultimately returns a value, implicitly returns a Yielding of that type, but it's best to explicitly declare this so that TypeScript can properly type check your yield expressions. (e.g.
function *(): Yielding<number> {}
for a generator function that ultimately returns a number.)Generator functions implementing this type should only ever
yield *
to things that are of Yielding type, such as a Job, to() or other generators declared Yielding.