Common JavaScript tasks without Redux

Example: How to display a login dialog and do login?

There are a few places in the app, where you need to initiate an action that displays Login Dialog to the user. For example, [Sign In] button in the toolbar being one of those, [Continue] button in the comment box is another, an Ajax response containing 401/403 error codes etc.

Login Dialog (modal)


Always start by thinking how a vanilla JS solution looks like before integrating a 3rd party library. The more libraries you have, the harder it may become to maintain and develop your app, especially when you onboard new members to your dev team. In case with client-stage management, a few lines of custom JS may solve the trick. If not, my next option would be Flux. If you need to manage most of the client state manually then I would consider using Redux. If you’re using Relay Modern, you can manage client state by using existing API provided by Relay.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Konstantin Tarkus

Konstantin Tarkus

Bringing the technical edge to early-stage companies with advice on software architecture, best practices, database design, web infrastructure, and DevOps.