Skip to content

Conversation

mairatma
Copy link
Contributor

@mairatma mairatma commented Nov 8, 2023

What is the purpose of this pull request?

Created a new config that can be passed per request, to customize local caching behavior.

What problem is this solving?

We need more complex behaviors for our local caches, and this will allow customizing the logic per request.

How should this be manually tested?

  • Build the codebase and verify that there were no errors.
  • Link this npm package into an app, within a linked workspace, and make sure that http client calls are working as before.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

Comment on lines +5 to +7
get (key: K, fetcher?: () => Promise<FetchResult<V>>, options?: LocalCacheOptions): Promise<V | void> | V | void,
has (key: K, options?: LocalCacheOptions): Promise<boolean> | boolean,
set (key: K, value: V, maxAge?: number | void, options?: LocalCacheOptions): Promise<boolean> | boolean,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows all cache classes to receive this new optional param.

@mairatma mairatma force-pushed the feat/cacheOptions branch 2 times, most recently from 8c42d10 to d9594b4 Compare November 8, 2023 13:51
@mairatma mairatma marked this pull request as ready for review November 8, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant