You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2021. It is now read-only.
I was wondering if there could be a race condition.
Suppose I try to edit an article, Editor component si being mounted and EDITOR_PAGE_LOADED event is dispatched.
The request is sent to server, but the server didn't respond yet. (1)
Now I go back to homepage, editor component is unmounted, EDITOR_PAGE_UNLOADED is dispatched, the state related to editor component is cleared.
Now I try to edit another article, Editor component is mounted, EDITOR_PAGE_LOADED is dispatched for another article.
The request is sent to server, and server responds instantly. (2)
Reducer for EDITOR_PAGE_LOADED action triggered by second request is called. Everything cool still.
Now, the first request (1) is full-filled, and reducer for EDITOR_PAGE_LOADED action is called, with information from first request, and in the editor I will see the contents for first article I tried to edit, instead of the second one.