1. 3
  1.  

  2. 1

    I’ve just revised the gist, in case anyone is interested. I decided to decouple the sync and async variants as I had done originally, so that it’s hopefully a little easier to follow and play with.