code: function wrapFn (gen) {
    if (!is.function(gen)) throw new Error('Middleware must be a function')
    if (!is.generator(gen)) return gen
  
    // wrap generator with raco
    var fn = raco.wrap(gen)
    return function (ctx, next) {
      fn.call(this, ctx, next)
    }
  }
docs: wrap ginga middleware function