【发布时间】:2021-05-27 03:15:02
【问题描述】:
const response = yield call(fetch, `${config.backendUrl}/verify`, {
method: 'POST'
})
const responseJson = yield call(response.json)
console.log(responseJson)
这是来自 redux-saga 的代码。产量挂起,console.log 不打印任何内容。但是,如果我用() => response.json() 替换response.json,它就可以工作。为什么?
【问题讨论】:
-
也许
call正在传递导致response.json采取不同行动的参数。试试(...args) => { console.log(args); response.json() }看看他们是什么 -
args似乎是空数组
标签: redux redux-saga yield