Skip to content

Create StorageMap#replace #471

Answered by cyrilletuzi
dev054 asked this question in Q&A
Discussion options

You must be logged in to vote

This is a common misconception, but client-side storage in general is just here to save some values for when the user leaves the application and when he/she comes back. But it should not replace your classic properties management, for many reasons:

  • responsibility principle: it is 2 different responsibilities
  • performance: even if this lib stores in indexedDb for better performances than localStorage, it is still heavier to access client-side storage than just a property of your classes
  • possible errors: much more errors can happen when getting values stored (modified by a malicious user, deleted by the browser, blocked by enterprise security policies, etc.)

So it is not the role of client…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cyrilletuzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #471 on December 08, 2020 21:10.