paramsChanged

Updated:

Listens for changed parameters.

Description

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.

Signature

tecton.sources.paramsChanged(callback: (params: Record<string, string>) => void): () => void;

Usage

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();

Parameters

callback

Release Notes

Tecton
0.19.0

Platform Support

UUX