A pausable computation that ultimately produces a value of type T.
An item of this type can be used to create a task or activity of type T, or
awaited in a Coroutine via yield * to obtain the value.
Any generator function that yields Suspend values and ultimately returns a
value, implicitly returns a Yieldable Coroutine of that type, but it's best
to explicitly declare this so that TypeScript can properly typecheck your
yield expressions. (e.g. function *(): Coroutine<number> {} for a
generator function that ultimately returns a number.)
Remarks
This interface is actually a subset of Coroutine, so coroutines are
always Yieldables.
A pausable computation that ultimately produces a value of type T.
An item of this type can be used to create a task or activity of type T, or awaited in a Coroutine via
yield *to obtain the value.Any generator function that yields Suspend values and ultimately returns a value, implicitly returns a Yieldable Coroutine of that type, but it's best to explicitly declare this so that TypeScript can properly typecheck your yield expressions. (e.g.
function *(): Coroutine<number> {}for a generator function that ultimately returns a number.)Remarks
This interface is actually a subset of Coroutine, so coroutines are always Yieldables.
Yields
Suspend<any>
Returns
T