Feature request: add clearCaches
method for testing
#1381
Labels
completed
This item is complete and has been merged/shipped
feature-request
This item refers to a feature request for an existing or new utility
parameters
This item relates to the Parameters Utility
Milestone
Use case
When testing code that uses the Parameters utility, and specifically some of the high-order functions like
getParameter
orgetAppConfig
, it's important that users have the ability to control cache eviction.Right now users can manually import the
DEFAULT_PROVIDERS
object and manually clean the cache of each provider, i.e.:This however results in unnecessary boilerplate code. There is an opportunity to provide a better DX by exposing a
clearCaches
helper function that incapsulate this code as well as any future underlying logic required to clean cache.Solution/User Experience
The function will iterate the
DEFAULT_PROVIDERS
and call theclearCache
method on each one.Alternative solutions
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: