Subscribe to refetch notifications for specific data types.
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.
tecton.sources.refetchRequired(dataType: string, callback: () => void): () => void;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();When using the refetchRequired source, there are important details to keep in mind.
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.
dataTypecallback