ngx-cache icon indicating copy to clipboard operation
ngx-cache copied to clipboard

clear method deletes every object in storage

Open janetttt opened this issue 7 years ago • 1 comments

I'm submitting a ...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request

Current behavior Method clear() of LocalStorageCacheService deletes all objects from the browser's local storage.

Expected/desired behavior Should only delete objects from the browser's local storage, which are also in the CACHE.

Minimal reproduction of the problem with instructions Not needed.

What is the motivation / use case for changing the behavior? I want to be able to delete all object in the cache at once, instead of removing them one by one using the method remove(key: string | number, wild = false).

Environment

  • Angular version: 5.x

  • Browser: N/A

  • For Tooling issues: N/A

janetttt avatar Aug 01 '18 20:08 janetttt

@janetttt sorry for the delay, had busy times. feel free to fire a PR and i'll approve.

fulls1z3 avatar Nov 22 '19 00:11 fulls1z3