# Subscription

```ts
interface Subscription<T, TDone>
```

The Effection equivalent of an [`AsyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator)

A subscription acts like a stateful queue that provides a sequence of values
via the next() method. Normally a subscription is created via a
[Stream](https://frontside.com/effection/api/v4/Stream.md).

### Examples
#### Example 1
```ts
let subscription = yield* stream;
let next = yield* subscription.next();
```

---


### Type Parameters
T


TDone


### Methods
<dl>
<dt class="border-dotted [&:not(:first-child)]:border-t-2 [&:not(:first-child)]:pt-3 [&:not(:first-child)]:mt-2"><h4 id="next" class="inline scroll-mt-[100px]">next</h4>(): [Operation](https://frontside.com/effection/api/v4/Operation.md)&lt;IteratorResult&lt;T, TDone&gt;&gt;</dt>
<dd class="flex flex-col [&>pre]:mb-3 [&>p:not(:first-child)]:mt-0" >
*No documentation available.*
</dd>
</dl>


### See
* https://effection.deno.dev/docs/collections#subscription

[View code](https://github.com/thefrontside/effection/tree/effection-v4.2.0/lib/types.ts#L184)
