I have an application in which I have multiple components as well as actions and reducers for each component. I am using redux-pack for promise handling as well.
So here is the situation, I just want to use a single reducer for my whole application which handles my page-loader. That means, whenever an API call start, the loader should show and it should hide when the API ends. I don't want to write a separate action for this.
Please help me with your suggestions. Thanks in advance.
, I don't have the proper idea
redux-pack
but I have achieved this usingreact-redux
. There is libraryreact-loading-overlay
library you can use it or create a newloading-overlay
own.https://github.com/derrickpelletier/react-loading-overlay Link of the library if you want.
Now coming to the code:-
I have created a global state in redux named as
loadingState