Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cache): cache decorator for automatic caching #10203

Merged
merged 4 commits into from
Jun 7, 2021

Conversation

JamieMagee
Copy link
Contributor

@JamieMagee JamieMagee commented May 28, 2021

Changes:

Added a cache decorator method for automatic caching (memoization) of any methods it's applied to.

TODO:

  • Correctly type it so that it can only be applied to async functions

Context:

Related to #8647

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Looks promissing, not sure if we can make it more type safe

lib/util/cache/package/decorator.spec.ts Outdated Show resolved Hide resolved
lib/util/cache/package/decorator.ts Show resolved Hide resolved
lib/util/cache/package/decorator.ts Outdated Show resolved Hide resolved
lib/util/cache/package/decorator.ts Outdated Show resolved Hide resolved
@JamieMagee JamieMagee marked this pull request as ready for review June 4, 2021 03:22
@JamieMagee JamieMagee requested a review from viceice June 4, 2021 14:55
.eslintrc.js Show resolved Hide resolved
lib/util/cache/package/decorator.ts Show resolved Hide resolved
@JamieMagee JamieMagee requested a review from viceice June 5, 2021 20:42
@JamieMagee JamieMagee enabled auto-merge (squash) June 7, 2021 16:20
@JamieMagee JamieMagee merged commit 52b63e4 into main Jun 7, 2021
@JamieMagee JamieMagee deleted the feat/cache-decorator branch June 7, 2021 16:28
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 25.38.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants