diff --git a/README.md b/README.md index c6d60cae..ea470fac 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ const client = createClient({ url: 'ws://iterators.ftw:4000/graphql', }); -function subscribe(payload: SubscribePayload): AsyncIterableIterator { +function subscribe(payload: SubscribePayload): AsyncGenerator { let deferred: { resolve: (done: boolean) => void; reject: (err: unknown) => void; @@ -261,8 +261,8 @@ function subscribe(payload: SubscribePayload): AsyncIterableIterator { : { value: pending.shift()! }; }, async throw(err) { - throw err - } + throw err; + }, async return() { dispose(); return { done: true, value: undefined };