1.1.0 • Published 7 years ago

@chegg/redux-loading-queue v1.1.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

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.