This is example code for wrapping the AsyncIterator in a graphql subscription resolver, so that you can execute cleanup code when a client unsubscribes.
Check out the blog post here!
To get working, simply clone the repo and run yarn
and yarn dev
.