javascript – User Session control react js
I have a question-answer web app. When the user clicks on ‘knee’ in my app, some questions about the knee are fetched from the backend. The user can answer these questions, and once all the questions are answered and submitted, the answers are sent to the backend, which then responds.
Now, consider this scenario carefully: If the user answers five questions but their device shuts down unexpectedly, when they reopen the browser, they should be able to see the previously answered questions.
How can I handle this situation so that the user’s data is retained even if their device shuts down? Also, I don’t want to send a request to the backend on every answer, as it would increase costs. What is the best way to handle this?”
Would you like me to improve it further or simplify it?
Read more here: Source link
