Socket
Book a DemoInstallSign in
Socket

react-progress-2-redux

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-progress-2-redux

React progress 2 (redux version)

latest
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

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())
    }
}

Keywords

react-progress-2-redux

FAQs

Package last updated on 03 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts