export function homePageProfileAction(list, name) {
return (dispatch) => {
dispatch(homePageProfileFetchId(list, name));
let promise = list.map(v => {
console.log(getUserHome(v));
return getUserHome(v).then(id => {
dispatch(homePageProfileFetchSuccess(id, v));
});
});
// Promise.all([promise])
// .then((res) => {
// console.log(res);
// dispatch(homePageProfileFetchSuccess(res, "top"));
// })
// .catch(err => {console.log(err); });
};
}
export function homePageProfileAction(list, name) {
return (dispatch) => {
dispatch(homePageProfileFetchId(list, name));
const promises = list.map(v => getUserHome(v));
Promise.all(promises)
.then((res) => {
dispatch(homePageProfileFetchSuccess(res, "top"));
})
.catch(err => {console.log(err); });
};
}
export function homePageProfileAction(list, name) {
return (dispatch) => {
dispatch(homePageProfileFetchId(list, name));
let promise = list.map(v => {
return getUserHome(v);
});
Promise.all(promise)
.then((ids) => {
console.log(ids);
//dispatch(homePageProfileFetchSuccess(res, "top"));
})
.catch(err => {console.log(err); });
};
}