rgl
redux-global-loader
npm i redux-global-loader
rgl

redux-global-loader

A Redux middleware for global loader

by Guilherme Louro

1.0.2 (see all)License:MITTypeScript:Not Found
npm i redux-global-loader
Readme

Redux Global Loader

Build Status Coverage Status

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.

Installation

Install with npm

$ npm install --save redux-global-loader

Import the middleware and include it after promiseMiddleware() in your applyMiddleware

import { globalLoaderMiddleware }  from 'redux-global-loader';

composeStoreWithMiddleware = applyMiddleware(
    ...
    promiseMiddleware(),
    globalLoaderMiddleware,
    ...
)(createStore);

Import the reducer loadingAll and include it in the combineReducers

import { combineReducers } from 'redux';
import { loadingAll } from 'redux-global-loader';

...
combineReducers({
    ...
    loadingAll,
    ...
});
...

Usage

import { Loading }  from 'redux-global-loader';

...
render() {
    return (
        <Loading>
            ...
            // Your loading component here
            ...
        </Loading>
    );
}
...

Contributing

If you want to contribute with this component: Contributing Documentation.

Downloads/wk

9

GitHub Stars

13

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.2
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial