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

Leif/property wrappers #7

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Leif/property wrappers #7

merged 3 commits into from
Jun 29, 2023

Conversation

0xLeif
Copy link
Owner

@0xLeif 0xLeif commented Jun 29, 2023

Adds

  • RequiredKeysCache: Introduced a new cache type, RequiredKeysCache, that ensures all specified keys are present in the cache at all times. This cache is useful when you have a defined set of keys that must always be present.

  • Global Caches: Added three global cache instances to simplify usage:

    • cache: A global cache instance for generic caching needs.
    • images: A global cache instance specifically designed for storing and retrieving images.
    • dependencies: A global cache instance for storing and retrieving dependencies.
  • Property Wrappers: Added three new property wrappers for easy cache integration:

  • Cached: A property wrapper that automatically retrieves and caches the value from the associated cache.

  • OptionallyCached: A property wrapper that retrieves the value from the associated cache if available, or falls back to the default value.

  • Resolved: A property wrapper that resolves the value from the associated cache, throwing an error if the value is missing or cannot be resolved.

With these additions, the Cache library becomes even more versatile and convenient to use. Happy caching!

@0xLeif 0xLeif added the enhancement New feature or request label Jun 29, 2023
@0xLeif 0xLeif self-assigned this Jun 29, 2023
@0xLeif 0xLeif merged commit 619ca28 into main Jun 29, 2023
@0xLeif 0xLeif deleted the leif/PropertyWrappers branch June 29, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant