0

I am writing a simple login page.

After user clicks on login button, I will be receiving a user authentication token if the login is successful.

I would like to store the token in to a simple sqlite storage.

Where should I put this logic? (The async opening db, updating db logic), I am currently putting them in the action creators for the SUCCESS_LOGIN action. But what does redux recommend?

Zhen Liu
  • 7,550
  • 14
  • 53
  • 96
  • Possible duplicate of [How to handle side effects in react/redux?](http://stackoverflow.com/questions/37755941/how-to-handle-side-effects-in-react-redux) – guzart Nov 11 '16 at 03:56

1 Answers1

1

There are multiple questions like this one:

How to handle complex side-effects in Redux?

How to handle side effects in react/redux?

Personally I use redux-saga, but redux-loop is also very popular.

If it's a simple application you could use redux-thunk or you are probably ok with your current approach, no need to add more libraries and boilerplate if you have all the functionality done.

guzart
  • 3,700
  • 28
  • 23
  • Cool I think i'll stick with redux-thunk for now. Will look at redux-saga when there are more side effects going on i guess. – Zhen Liu Nov 11 '16 at 17:02