Skip to content

schiehll/redux-loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-loading

Loading control with Redux

travis build Coveralls branch version MIT License

Example

import {createStore, combineReducers, applyMiddleware} from 'redux'
import {loadingReducer, loadingMiddleware} from 'redux-loading'

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

let action = {
  type: 'SOME_ACTION',
  meta: {
    loading: true
  }
}

store.dispatch(action)

let state = store.getState()
//state = {loading: {pending: 1, done: false}}

action = {
  type: 'SOME_OTHER_ACTION',
  meta: {
    loading: false
  }
}

store.dispatch(action)

state = store.getState()
//state = {loading: {pending: 0, done: true}}

About

Loading control with Redux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published