Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 693 Bytes

README.md

File metadata and controls

24 lines (19 loc) · 693 Bytes

redux-async-dispatch

How to use:

example for some ./connector.js

import { asyncConnect } from 'redux-connect';
import asyncLoader from 'redux-async-dispatch';

const mapAsyncActions = [{
  promise: ({ store: { dispatch, getState } }) =>
    asyncLoader(dispatch, getState(), [
      [getSomeState, loadSomething], // first array parameter function with @return boolean or boolean
      [false, loadSomething5], // if false will load
      dispatch(loadSomething2()),
      loadSomething3, 
      loadSomething4, // load without check state by loaded data
    ]),
}];

const mapStateToProps = () => ({});

export default asyncConnect(mapAsyncActions, mapStateToProps)(Component);