@chegg/redux-loading-queue

React loading component for multiple Redux actions

Stats

StarsIssuesVersionUpdatedCreatedSize
@chegg/redux-loading-queue
001.1.04 years ago4 years agoMinified + gzip package size for @chegg/redux-loading-queue in KB

Readme

Redux Loading Queue

A loading queue for Redux

npm install --save @chegg/redux-loading-queue

Usage

Add the loadingReducer to your store under loading.

import { createStore, combineReducers } from 'redux'
import { loadingReducer } from '@chegg/redux-loading-queue'

const store = createStore(
  combineReducers({
    loading: loadingReducer
  })
)

To add or remove an item with a certain id to the loading queue, use the provided actions.

import { loadingShow, loadingHide } from '@chegg/redux-loading-queue'

const uuid = '123e4567-e89b-12d3-a456-426655440000'

store.dispatch(loadingShow(uuid))

store.dispatch(loadingHide(uuid))

Wrap your loading view with AppLoading. The view will show as long as at least one item is in the queue.

<AppLoading>
  <div>Loading..</div>
</AppLoading>

Maintainers

Philip Stewart (@sodoku)

Yvan Volochine (@gusano)

License

Apache v2, Copyright 2016 Chegg Inc.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.