mercredi 31 octobre 2018

Is it fine to use sessionStorage instead of shared service

I would just like to know if it is bad to use sessionStorage instead of a sharedservice in Angular. The reason why is just because sessionStorage is so easy:

  • I can easily access it from anywhere in my app
  • I don't need to worry about importing it everywhere
  • I don't need to worry about circular injection issues

sessionStorage is just so easy to use that I would love to use it to store stuff like the current logged in user, user access, base URL for calls...everything I would put in a sharedservice




Aucun commentaire:

Enregistrer un commentaire