我的目的是从谷歌地图中获取方向数据。google函数以原点、目的地、travelMode和回调作为参数。// Get direction data from Google API.,我的fetchDirections()生成器无法识别回调中的结果。我应该如何修改上面的代码,以便能够在回调函数中利用产量?
更新:通常在redux-saga中使用生成器。出于测试目的,我调用生成器</em
我有以下redux saga,它进行api调用并处理结果:import { call, put } from 'redux-sagaactions.fetchWorksSuccess(normalized)) yield put(actions.fetchWorksFail(error))}impor
我有一个回调,我需要返回true或false来触发一些外部操作,我需要在这个回调中进行API调用,所以我需要获取状态并在回调中调度一些操作,我不知道我是否可以使用eventChannel,因为这个回调不能是一个生成器,只能是一个普通的函数。我需要做这样的事情。to wait for the action to finish and then return something
// based on the response from the AP