react-progress-2-redux

1.1.2 • Public • Published

example

import { Progress, reducer } from 'react-progress-2-redux'

class Application extends React.PureComponent {
    render () {
        return (
            <div>
                <Progress />
                {/* the content */}
            </div>
        )
    }
}

let store = createStore(
    combineReducers({
        progressRedux: reducer
    })
)

ReactDOM.render(
    <Provider store={store}>
        <Application />
    </Provider>,
    document.querySelector('#root')
)
import { show, hide } from 'react-progress-2-redux'

// your-reducer.jsx
export function loadUsers () {
    return async dispatch => {
        dispatch(show())
        await myCoolAsyncRequest()
        dispatch(hide())
    }
}

// your-reducer.jsx
export function loadTasks () {
    return async dispatch => {
        dispatch(show())
        dispatch(show())
        dispatch(show())
        let data = await myCoolAsyncRequest()
        dispatch(hideAll())
    }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    2
  • 1.1.1
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i react-progress-2-redux

Weekly Downloads

2

Version

1.1.2

License

MIT

Last publish

Collaborators

  • rsqw