I am working with esri gis api for js 4.15 typescript in an Angular 9 application.
This works:
var graphic = new graphic({geometry: point, symbol:sign}):
var layer = new GraphicsLayer({id: 'mylayer'});
view.map.add(layer);
layer.when((layerdone)=>{
setInterval(()=>{
graphic.visible != graphic.visible;
}, 1000);
});
layer.add(graphic);
But this does not:
var glayer = view.map.layers.find((layer)=>{ layer.id === 'mylayer'});
var graphic = glayer.graphics.find():// lets say its found
var count = 0;
var pulser = setInterval(()=>{
graphic.visible != graphic.visible;
if((++count) >= 10){
clearInterval(pulser);
pulser = undefined;
graphic.visible = true;
}
}, 1000);