From 4612e26e952e4995089cff7e87c867c658cec1f4 Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Wed, 8 Sep 2021 23:43:21 +0200 Subject: [PATCH] docs: subscribe returns async generator [skip ci] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 };