What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-15 12:05:02
react map wait axios call
const postIds = ['123', 'dn28e29', 'dn22je3']; const posts = posts.map(post => { return axios .get(`https://example.com/post/${post.id}`) .then(res => res.data) .catch(e => console.error(e)); } Promise.all(posts).then(res => co... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5