node-ts-cache
node-ts-cache copied to clipboard
feat: new Methods
What this PR is about: Adding some new methods for easier and better access and management
What has been changed:
- Created
removeItemmethod in FS-Storage, Memory-Storage, CacheContainer, and Storage types - Created
getAllmethod that would return all saved Data in FS-Storage, Memory-Storage, CacheContainer, and Storage types - Added an option to return the saved data before removing it on
CacheContainerClass - Instead of setting a key value to
nullwhich still takes storage, we remove them withremoveItemmethod
What needs to be changed:
unfortunately, I don't have any experience with Redis, so I left storage-elasticsearch and storage-ioredis unchanged,
I hope you can fix or find a solution for them.
Possible solutions:
We can remove the removeItem & getAll methods from CacheContainer, however, users can still access those methods from storage directly and we can implant generic typings of methods in the IStorage interface instead.
@havsar I would love to hear your idea and your response to this PR and some information such as the time you will be able to review this PR File changes and the Merge time of it.