1.0.3 • Published 6 years ago

light-redux-loading v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

light-redux-loading

a light scale of redux loading

loadingbar

npm

yarn add light-redux-loading

core

limport loadingReducer from 'light-redux-loading'

import {
    LoadingBar
    showLoading,
    hideLoading,
     } from 'light-redux-loading'

useage

component

import LoadingBar from 'light-redux-loading'

export default class Header extends React.Component {
  render() {
    return (
      <header>
        <LoadingBar />
      </header>
    )
  }
}

reducers

import { combineReducers } from 'redux'
import { loadingReducer } from 'light-redux-loading'

const reducer = combineReducers({
  loading: loadingReducer,
})

action

import { showLoading, hideLoading } from 'light-redux-loading'

const handleInitalAction = () => {
    return (dispatch) => {

        dispatch(showLoading())

        API().fetchData()
        .then((data) => {
            dispatch(handleInitaldata(data))

            dispatch(hideLoading())
        })
    }
}
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago