我的 Koa 应用程序中有以下代码:
exports.home = function *(next){
yield save('bar')
}
var save = function(what){
var response = redis.save('foo', what)
return response
}
但我收到以下错误:TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "OK"
现在,“ok”是来自 redis 服务器的响应,这是有道理的。但我无法完全掌握此类功能的生成器的概念。有什么帮助吗?