score:2
i'm not sure this is the answer you are looking to but it seems that you just have to use map to create an array of object with the shape you are looking for.
function callingapis() {
const promises = urls.map(url => axios.get(url, { headers }));
promise.all(promises).then(responses =>
responses.map(({data}) => {
return [
{"id": data.id},
{"source": data.source},
{"pathname": data.paths.name}
{"pathdescription": data.paths.description},
]
).then(filtereddata => setdata(filtereddata))
};
Source: stackoverflow.com
Related Query
- javascript csv header for all nested objects
- In Javascript does async await wait for all nested functions to complete?
- How to handle 'undefined' error for dynamically changing deep nested objects in javascript
- Attach Authorization header for all axios requests
- React: Setting State for Deeply Nested Objects w/ Hooks
- How to create common Header and footer for all child pages in reactjs?
- Set all values of nested object to false except for one
- Best practices for importing deeply nested Javascript components
- setState for nested objects
- React JS: set all values of nested object to false except for one
- Javascript - Change name of all object keys in nested arrays
- use ES6 .map() on multiple times nested objects for react components
- Grouping objects inside nested javascript arrays
- Look up nested arrays of objects for a match by separate criteria on each level
- Dynamically Set header for all requests ( React, super-agent )
- What is most performant way to iterate nested javascript objects and render inside jsx
- Alternatives to nested for loops in Javascript
- Nested Array Of Objects into Downloadable CSV in react
- Using Lodash countBy for nested objects
- How to Sort Dates, Numbers, Strings from the array of nested JSON objects in Javascript
- Javascript (React + Flow) - Destructuring with nullable nested objects
- How to update a key for all my objects that are in an array
- Not able to access nested objects inside a JSON in Javascript
- Rendering all nested objects from object in React
- Finding values or objects in a json file with nested objects and passing the result object to child in Javascript and react
- Change the values of all nested objects Immutable.js
- Error: Objects are not valid as a React child when trying to map a nested array for a table component in React
- filter nested array of objects using javascript
- Javascript -> Adding up values of nested objects with the same name
- javascript - calculate success rate for every 10 objects in an array
More Query from same tag
- React useContext not passing value down to deeply nested children
- How can i pass multiple records to detail page in ReactJs
- testing custom react methods with jest and enzyme
- Get all the selected options on each onChange event
- Flow erroring "cant resolve module" when importing node modules
- Adding Local Storage option in my ToDo List site
- Typescript: React Context higher order component type error
- validateDOMNesting(...): <span> cannot appear as a child of <option>
- Reactjs Input Upload doesn't return local URL
- Deploy Node Express app to Heroku that serves React app
- Node.js - how to inspect request data?
- How to chain redux actions using returned result of the previous action?
- Does nock only work if there is an Internet connection?
- How to extract multiple theme stylesheets with webpack?
- Redux-Form Understanding Multipage Form Ajax PUT
- Is this the correct way of using React.Suspense?
- How to change style of MenuItem (antd) when changing dynamically?
- How to automaticaly send ALL errors from javascript to Sentry?
- Invoking epics from within other epics
- Update State in redux in background after every few minutes in ReactJS
- Map through an array in React
- Grouping objects inside nested javascript arrays
- Highcarts: Hide xAxis categorie when serie is not visible
- React Proptype for array and its properties
- Logo not linked back to the homepage?
- Error handling Apollo-client with redux-observable
- Image from JSON file to React JS file not displaying
- React.js controlled text cursor focus issue
- How to add a shared layout when using NextJS and Auth0?
- React-Redux-Forms enable checkbox in another react component