clearCache

Updated:

Clears the cache associated with a provided route or routes.

Description

Responses to requestExtensionData and requestPlatformData are stored in a shared cache between all extensions. Tecton provides two methods to work with the cache: clearCache for clearing the cache and notifying others, and cacheCleared which enables an extension to be notified when the cache for a route is cleared.

Signature

tecton.actions.clearCache(routePrefixes: any): Promise<void>;

Usage

Clear the cache for multiple routes and then refetch the data.

tecton.actions.clearCache('/accounts', '/foo', '/bar/1').then(function() {
    fetchAccounts();
    fetchFoo();
    fetchBar(1);
});

Additional Information

When using the clearCache action, there are important details to keep in mind.

Route Specificity

When using clearCache, pass the most general routes that have been affected. Any specific routes that start with the passed string will also be cleared and notified. For example, clearCache('/account') will notify someone who has subscribed using cacheCleared('/account/1').

Parameters

routePrefixes

Release Notes

Tecton
0.19.0

Platform Support

UUX
Config