我需要在管道中添加函数,但是它总是显示错误fn不是函数
const updateCodeEpic = action$ =>
action$.pipe(
ofType(UPDATE_REQUEST),
switchMap(action =>
from(AppointmentApi.updateCode(action.payload.model)).pipe(
map(data => ({ type: UPDATE_SUCCESS, result: {
id: action.payload.model.id
}})),
catchError(error => of({ type: UPDATE_FAILURE }, addErrorToast(error.data.errorMessage))),
myFunction(action)
)
)
);
和我的功能
var myFunction = (action) => {from(Api.loadData(action.payload.model.id, null, true)).pipe(
map(data =>
({ type: DATA_SUCCESS, items: data })
)
)}