Environment: React18, redux-toolkit (createAsyncThunk).
I have a request for some data that should be set as default in store. This request should be done only once during store lifecycle.
My current flow: Redux-toolkit initialize store and React initialize app -> i'm telling React to make request -> after getting response i'm dispatching it to store -> re-render comes and show my data. It works. Pretty familiar and standard, right?
Solution i'm looking for: As this request should be done only once i want to define this request as a part of Redux-toolkit initialization flow and completely remove this from React component. So i looking for an opportunity to tell Redux-toolkit: Hey, dude! As soon as you finish all your initialization, please make this request (run this thunk), get responce, set it to store, and never do this again. Does anyone have any idea how to achieve this behavior with the Redux-toolkit api?