refetchRequired

Updated:

Subscribe to refetch notifications for specific data types.

Description

Subscribes to notifications that data of a specific type needs to be refetched. The platform broadcasts these notifications when underlying data has changed and features should refresh their data.

Signature

tecton.sources.refetchRequired(dataType: string, callback: () => void): () => void;

Usage

Listen for refetch notifications for 'Accounts' data.

const unsubscribe = tecton.sources.refetchRequired('Accounts', () => {
    console.log('Accounts data changed, refetching...');
    fetchAccountsData();
});

Later, to stop listening:

unsubscribe();

Additional Information

When using the refetchRequired source, there are important details to keep in mind.

UUX Refetch Notifications

The UUX platform is expected to cache accounts and relies on the refetchRequired and notifyRefetchAccounts capabilities to manage cache invalidation. When notifyRefetchAccounts is invoked on the UUX platform and Account data is removed from cache, any registered refetchRequired callbacks for the Accounts data type will be triggered, prompting the extension to refresh its own cached account data.

Parameters

dataType
callback

Release Notes

Tecton
0.1.0

Platform Support

UUX