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

cache decorator #3

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

JohnDoePlusPlus
Copy link

No description provided.

@JohnDoePlusPlus JohnDoePlusPlus changed the title cach decorator cache decorator Nov 9, 2019
package.json Outdated Show resolved Hide resolved
test/utils.ts Outdated Show resolved Hide resolved
lib/cache/storages/MemoryStorage.ts Outdated Show resolved Hide resolved
lib/cache/storages/Storage.ts Outdated Show resolved Hide resolved
lib/cache/hash/hash.ts Outdated Show resolved Hide resolved
lib/cache/expirations/Expiration.ts Outdated Show resolved Hide resolved
lib/cache/expirations/AbsoluteExpiration.ts Outdated Show resolved Hide resolved
lib/cache/expirations/SlidingExpiration.ts Outdated Show resolved Hide resolved
lib/cache/expirations/SlidingExpiration.ts Outdated Show resolved Hide resolved
examples/cache.ts Outdated Show resolved Hide resolved
lib/cache/caches/Cache.ts Outdated Show resolved Hide resolved
lib/cache/index.ts Outdated Show resolved Hide resolved
lib/cache/index.ts Outdated Show resolved Hide resolved
lib/cache/storages/Storage.ts Outdated Show resolved Hide resolved
lib/cache/expirations/AbsoluteExpiration.ts Outdated Show resolved Hide resolved
lib/cache/expirations/AbsoluteExpiration.ts Outdated Show resolved Hide resolved
lib/cache/caches/ClassCache.ts Outdated Show resolved Hide resolved
lib/cache/factories/storeFactory.ts Outdated Show resolved Hide resolved
lib/cache/factories/cacheFactory.ts Outdated Show resolved Hide resolved
move scope logic from cache to new class cache manager
Copy link
Member

@dimadeveatii dimadeveatii left a comment

Choose a reason for hiding this comment

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

Please cover with unit tests each internal file.

lib/cache/cacheManager/CacheManager.ts Outdated Show resolved Hide resolved
lib/cache/cacheManager/InstanceCacheManager.ts Outdated Show resolved Hide resolved
lib/cache/cacheManager/InstanceCacheManager.ts Outdated Show resolved Hide resolved
lib/cache/cacheManager/ClassCacheManager.ts Outdated Show resolved Hide resolved
lib/cache/cacheManager/CacheManager.ts Outdated Show resolved Hide resolved
lib/cache/expirations/factory.ts Outdated Show resolved Hide resolved
lib/cache/index.ts Outdated Show resolved Hide resolved
lib/cache/index.ts Outdated Show resolved Hide resolved
lib/cache/storages/MemoryStorage.ts Show resolved Hide resolved
lib/cache/storages/MemoryStorage.ts Outdated Show resolved Hide resolved
replace factory functions to class
rename CacheManager to CacheProvider
remove keysStorageIn MemoryStorage (now is using keys from map)
improve code in factories and in SlidingExpiration
add unit tests
Copy link
Member

@dimadeveatii dimadeveatii left a comment

Choose a reason for hiding this comment

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

Please review unit tests, make sure you don't test internal state, only the public interface. Each unit test should have one assertion.

lib/cache/cacheProvider/InstanceCacheProvider.ts Outdated Show resolved Hide resolved
lib/cache/index.ts Outdated Show resolved Hide resolved
test/cache/cacheProvider/ClassCacheProvider.spec.ts Outdated Show resolved Hide resolved
test/cache/cacheProvider/ClassCacheProvider.spec.ts Outdated Show resolved Hide resolved
test/cache/cacheProvider/ClassCacheProvider.spec.ts Outdated Show resolved Hide resolved
test/cache/cacheProvider/ClassCacheProvider.spec.ts Outdated Show resolved Hide resolved
@JohnDoePlusPlus JohnDoePlusPlus force-pushed the story/cache branch 2 times, most recently from 5c66cec to 20437a4 Compare November 18, 2019 13:12
improve unit tests
lib/cache/storages/MemoryStorage.ts Outdated Show resolved Hide resolved
test/uitls/hash.spec.ts Show resolved Hide resolved
test/utils.ts Outdated Show resolved Hide resolved
lib/cache/storages/factory.ts Outdated Show resolved Hide resolved
lib/cache/expirations/factory.ts Outdated Show resolved Hide resolved
test/cache/caches/factory.spec.ts Outdated Show resolved Hide resolved
test/cache/expirations/AbsoluteExpiration.spec.ts Outdated Show resolved Hide resolved
test/cache/expirations/SlidingExpiration.spec.ts Outdated Show resolved Hide resolved
change factories, not create is with parameters
improve unit tests
@dimadeveatii
Copy link
Member

We should analyze the possibility to use the popular library lru-cache.

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.

2 participants