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

method to extract data written by native localStorage

Open zorrme opened this issue 6 years ago • 1 comments

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] 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 -->
[x ] Feature request
[ ] Documentation issue or request

Current behavior CacheService tries to extract data with meta info. If the data was written by localStorage then the cache service would crash.

Expected/desired behavior It will be better if we could have a method to extract data without meta info.

Minimal reproduction of the problem with instructions

  1. Write something using localStorage e.g. localStorage.setItem('test', 'test)
  2. Try to use CacheService to get 'test' i.e. cache.get('test')

What is the motivation / use case for changing the behavior? Cache Service should be backward compatible with localStorage

Environment

  • Angular version: X.Y.Z 6.0.2

  • Browser:

  • [x ] Chrome (desktop) version 66
  • [ ] Chrome (Android) version XX
  • [ ] Chrome (iOS) version XX
  • [ ] Firefox version XX
  • [ ] Safari (desktop) version XX
  • [ ] Safari (iOS) version XX
  • [ ] IE version XX
  • [ ] Edge version XX
  • For Tooling issues:
  • Node version: 10.1.0
  • Platform: Mac
  • Others:

zorrme avatar May 18 '18 19:05 zorrme

@zorrme 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