I have a complex react-native application and I'm using .net api for backend. When session timeout occurs on api side, I want to automatically logout the user and return to login page. But I can't use dispatch in the class that I'm doing api call. Because its not a component or a redux file. To navigate to the login page I need to dispatch some actions. Is there a way to do is? If I use Redux-Toolkit, does it work? I am looking for an easier solution because start using Redux toolkit in the project is a big effort for me right now.
Here is my project's structure:
Thanks in advance.