i am trying to promise in arcgis js 4.19 .
code :
promise.all(layerPromises)
.then(()=>{
console.log("hello")
})
**layerPromises is an array of promises**
when i run this code in 4.17 it is working fine but with 4.19 not able to exceute it
Do you have a snippet showing what layer promises is doing? Are they layer.loads() or queries? If you add a .catch() what is the error message? You wouldn't happen to be using Angular are you?
hi,
i am not using angular it is javascript.
layerpromises are layer.loads().it is checking for everylayer loads successfully or not.
const fdwh = (view,featureLayer)=>{
try{
return new Promise((resolve,reject)=>{
view.whenLayerView(featureLayer).then((layerview) => {
watchutil.whenFalseOnce(layerView,"updating").then(()=>{
resolve();
}
}
}
}
}
for(var i =0;i<featurelayerarray.length;i++)
{
layerPromises.push(fdwh (view,featurelayerarray[i]))
}
promise.all(layerPromises)
.then(()=>{
console.log("hello")
})