2 ms·
Not sure what you mean by "bad code duplication"? If you have a need for a rich front end application you're going to need to implement some state management on
by chrisco255 7y ago
Not sure what you mean by "bad code duplication"? If you have a need for a rich front end application you're going to need to implement some state management on the front end. The back end is responsible for running APIs, managing services, interacting with the database, and performing validation on API calls. A good REST API is typically stateless. But a front end can't be stateless. Let's take Facebook for example. The front end needs to track which conversations are open, which users in your friend list are "active" or "away" and render the appropriate icon, threads of conversations need to be woven together on various panes on the screen, visual feedback about whether a post has already been "liked" by the current user needs to be provided, etc. It needs to be able to receive real-time updates and post those to the UI in the proper location. There's a ton of complexity there and you have to place that state in memory on the client somewhere. Managing front end state effectively is crucial for complex applications.