Tutorial by Examples

var firstItem = fetch("/api1").then(x => x.json()); var secondItem = fetch("/api2").then(x => x.json()); Promise.all([firstItem, secondItem]).spread((first, second) => { // access both results here, both requests completed at this point });

Page 1 of 1