我有这样的文件史诗(redux-observable):
export const intervalChartEpic = (action$, store) =>
action$.ofType(FETCHING_CHART_DATA_ONE_DAY_SUCCESS)
.filter(() => (store.getState().currentPeriod === PERIOD_ONE_DAY))
.mergeMap(() => Observable
.interval(10000)
.takeUntil(store.getState().currentPeriod !== PERIOD_ONE_DAY)
.switchMap(() => ajax.getJSON(updateChartOneDayUrl(store))
.map(response => fetchIntervalChartDataSuccess(response))
.catch((err) => {
console.log('============Position 1============');
console.log(err);
return Observable.of(fetchChartDataFailure(err));
})
)
.catch((err) => {
console.log('============Position 2============');
console.log(err);
return Observable.of(fetchChartDataFailure(err));
});
);
它出现了一个错误,比如
"You provided 'false' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."
位置2错误,这意味着它在switchMap()
功能上出错,我不知道为什么,这里的任何人都可以帮助我吗???,非常感谢!!!