내 액션 작성자에 다음 코드가 있습니다.이 코드는 감속기 - "subData"에서 볼 수 있습니다 : [{}, {}, {}}} - 프린트 할 때 동작합니다 실제로 약속입니다 - 그때를 사용하여 변환을 시도했지만 운이 .. 하루 종일 고투하고있다 ... 어떤 아이디어?디스패치 후 감속기의 빈 객체
export function getMainData() {
return async function getMainData(dispatch) {
const { data } = await getMainDataAPI();
const subData = data.map((item) => {
const endpoint = 'build with item.name';
return Request.get(endpoint);
});
console.log('subddd' + subData); prints -> **[object Promise],[object Promise],[object Promise]**
dispatch({
type: GET_DATA_AND_SUBDATA,
payload: { data, subData }
});
};
}
async function getMainDataAPI() {
const endpoint = 'url';
return Request.get(endpoint);
}
[reducer.state.props의 중첩 된 동작이 중첩 된 동작에서 정의되지 않음] (https://stackoverflow.com/questions/47070786/reducer-state-props-is-undefined-in-nested-actions- 반응식 - redux) – ivan