Listens for changed parameters.
paramsChanged allows you to listen for changed parameters. The passed function will be called every time the parameters change with a single argument containing a hash of the new parameters and their values. It is intended to be used with setParams and clearParams and also allows you to unsubscribe from a particular passed function.
tecton.sources.paramsChanged(callback: (params: Record<string, string>) => void): () => void;Listen for parameter changes.
const unsubscribe = tecton.sources.paramsChanged((params) => {
console.log('Current params:', params);
if (params?.accountId) {
loadAccount(params.accountId);
}
});Later, to stop listening:
unsubscribe();callback