DimiMikadze / node-redux-auth

Token authentication system using Node, Mongo, React, Redux
181 stars 41 forks source link

redux-persist/redux-storage #2

Closed lucasbento closed 8 years ago

lucasbento commented 8 years ago

Are there any reasons to use this instead of redux-persist or redux-storage?

DimiMikadze commented 8 years ago

are there any reasons to use those libraries over native localStorage ?

sibelius commented 8 years ago

these libs provide more idiomatic redux code

Imagine that after loading the token you also need to check if there are new notifications for this user, or that you need to move to another URL based on the type of user

you would add all this code in this: https://github.com/DimitriMikadze/node-redux-auth/blob/master/client/src/app/index.js#L19

making it a little bit hard to read, and even harder to test

lucasbento commented 8 years ago

If you also wish to persist state and exclude a few ones (such as errors, searches, etc), your code can become a little monster.

In other words, it's not easy to scale.

DimiMikadze commented 8 years ago

Thanks guys! I'll use them definitely when i'll need them.