Skip to content

Commit

Permalink
docs: subscribe returns async generator [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Sep 8, 2021
1 parent 8e72479 commit 4612e26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const client = createClient({
url: 'ws://iterators.ftw:4000/graphql',
});

function subscribe<T>(payload: SubscribePayload): AsyncIterableIterator<T> {
function subscribe<T>(payload: SubscribePayload): AsyncGenerator<T> {
let deferred: {
resolve: (done: boolean) => void;
reject: (err: unknown) => void;
Expand Down Expand Up @@ -261,8 +261,8 @@ function subscribe<T>(payload: SubscribePayload): AsyncIterableIterator<T> {
: { value: pending.shift()! };
},
async throw(err) {
throw err
}
throw err;
},
async return() {
dispose();
return { done: true, value: undefined };
Expand Down

0 comments on commit 4612e26

Please sign in to comment.