Obs: Redux Promise Middleware is required
A redux middleware with redux-promise-middleware's integration that shows the Loading while there is one or more than one pending promises in the current page. The loading state will be hidden as soon as all Promises gets completed.
$ npm install --save redux-global-loader
promiseMiddleware()
in your applyMiddleware
import { globalLoaderMiddleware } from 'redux-global-loader';
composeStoreWithMiddleware = applyMiddleware(
...
promiseMiddleware(),
globalLoaderMiddleware,
...
)(createStore);
loadingAll
and include it in the combineReducers
import { combineReducers } from 'redux';
import { loadingAll } from 'redux-global-loader';
...
combineReducers({
...
loadingAll,
...
});
...
import { Loading } from 'redux-global-loader';
...
render() {
return (
<Loading>
...
// Your loading component here
...
</Loading>
);
}
...
If you want to contribute with this component: Contributing Documentation.
Version | Tag | Published |
---|---|---|
1.0.2 | latest | 5yrs ago |