Skip to content

Latest commit

 

History

History

redux-loading-queue

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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.