taiga-family/ng-web-apis

[FEATURE] Missed SessionStorage?!

WuglyakBolgoink opened this issue · 3 comments

  1. why I need LOCAL_STORAGE? instead of normal using localStorage in code?
  2. why you create only LOCAL_STORAGE and not SESSION_STORAGE too?
  1. Accessing global objects is bad practice in Angular applications. They do not always exist, like in case of Angular Universal server-side rendering (see our sister package @ng-web-apis/universal where we provide SSR mocks for tokens from this library). It is also much easier to test since you can effortlessly mock dependencies from DI or even switch to some other concrete realization at some point.
  2. Initially we add only things we need in our own applications to this package. SESSION_STORAGE is a good idea, thanks for bringing it up, I will add it in a day or two.

Hi!

Today we released a version 1.6.0 with SESSION_STORAGE token (#10). Thank you!

@MarsiBarsi tnx a lot!