const iconsLoaded = new Promise((resolve, reject) => {
new Promise.all(
Object.keys(icons).map(iconName =>
// IconName--suffix--other-suffix is just the mapping name in iconsMap
Ionicons.getImageSource(
iconName.replace(replaceSuffixPattern, ''),
icons[iconName][0],
icons[iconName][1]
))
).then(sources => {
Object.keys(icons)
.forEach((iconName, idx) => (iconsMap[iconName] = sources[idx]));
// Call resolve (and we are done)
resolve(true);
});
});
who can help me understand why following code working:
new Promise.all().then() ... i test this code in jsfiddle tell me an TypeError:
Promise.all is not a constructor
who can help me understand why following code working: new Promise.all().then() ... i test this code in jsfiddle tell me an TypeError: Promise.all is not a constructor