I'm attempting to merge two arrays that contain objects into a single array containing all the objects. Hopefully, this explanation makes sense.
getEntries() {
const linksArr = ['/api/aggregated', '/api/techmetro'];
axios.all(linksArr.map(l => axios.get(l))).then(axios.spread((...res) => {
// all requests are now complete
this.articles = res;
}));
},
The current result I'm getting is:
articles:Array[2]
0:Object
config:Object
data:Object
data:Array[10]
0: Object
...
meta:Object
headers:Object
request:XMLHttpRequest
status:200
statusText:"OK"
1:Object
config:Object
data:Object
data:Array[1]
0: Object
0:Object
meta:Object
headers:Object
request:XMLHttpRequest
status:200
statusText:"OK"
However, my goal is:
articles:Array[11]
0: Object
...
What am I overlooking? Thank you very much.