Hello! I'd like to perform some actions when a layer is refreshed. I have a Feature Layer for which I'm explicitly setting the refresh interval and then trying to listen to the "refresh" event (as defined on the documentation: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#events-summary)
layer.refreshInterval = 1; // Refresh every 1 minute
layer.on("refresh", (event) => {
console.log("layer refreshed!");
});The problem is that the refresh event doesn't trigger. I can confirm that the layer is actually refreshing, as I can see the requests going out every minute and the layer updating on the map.
What's also interesting is that the "refresh" event is not defined in the TypeScript definitions on arcgis-js-api.d.ts. Only the other four:
on(name: "edits", eventHandler: FeatureLayerEditsEventHandler): IHandle;
on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle;
on(name: "layerview-create-error", eventHandler: FeatureLayerLayerviewCreateErrorEventHandler): IHandle;
on(name: "layerview-destroy", eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle;
The event is supposed to have been there since version 4.0 according to the docs.
Environment:
- ArcGIS JS API 4.20
- Experience Builder 1.5
- ArcGIS Enterprise 10.9.0
Any thoughts?
Thanks!!
Alejandro