Hello All,
I'm trying to create a custom widget which watches the configured DataSource for changes to the layer definition query (i.e. monitors when an attribute filter has been applied/removed). I've tried something like:
// called once when DataSourceComponent loads
function onDataSourceCreated (ds: DataSource) {
// uses a user-defined type guard using type predicate
const featureLayerDataSource = isFeatureLayerDataSourceType(ds) ? ds : undefined
const queryParams = featureLayerDataSource.getCurrentQueryParams()
// TODO why does watch never see changes to where property?
reactiveUtils.watch(
() => queryParams.where,
str => { setQueryParams(str) }
)
}
I can make it work when using a DataSourceFilterChange action but can't understand why the same result cannot be obtained using the reactiveUtils and watching the DataSource directly
Thanks!
--john