Skip to content

Conversation

@teogeb
Copy link
Contributor

@teogeb teogeb commented Nov 11, 2024

Simplify sdk's CacheAsyncFn utility function API. No functionality changes.

Changes

  • rm onEviction option (not used)
  • rm cachePromiseRejection (always false)
  • all opts params are required
  • use new MapKey type
  • use Promise instead of PromiseLike

Style

  • renamed caches.ts toCacheAsyncFn.ts
  • moved tests from promises.test.ts to CacheAsyncFn2.test.ts (as there is already CacheAsyncFn2.test.ts)
    • some @ts-expect-error functionality was removed (see commit 500fbca)

Future improvements

  • Could improve the naming of the function and/or implement it as a class?
  • Merge CacheAsyncFn2.test.ts and CacheAsyncFn2.test.ts

@teogeb teogeb merged commit 14599b8 into main Nov 11, 2024
@teogeb teogeb deleted the simplify-sdk-cachefn branch November 11, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants