react-redux-shared-dispatch
Small library which allow you to dispatch multiple redux actions and only perform it once, to prevent multiple components firing multiple AJAX calls.
Last updated 2 years ago by tryingtoimprove .
Original npm · Tarball · package.json
$ cnpm install react-redux-shared-dispatch 
SYNC missed versions from official npm registry.

Small library which allow you to dispatch multiple redux actions and only perform it once, to prevent multiple components firing multiple AJAX calls.

import sharedDispatch from "react-redux-shared-components";

class MyComponent extends React.Component {
  componentDidMount() {
    this.props.onRequestData();
  }
  
  render() { return <div/>}
}

const mapDispatchToProps = {
  onRequestData: () => async (dispatch) => {
    // Excute AJAX calls
  }
};

export default sharedDispatch(mapDispatchToProps)(MyComponent);

Current Tags

  • 0.1.0                                ...           latest (2 years ago)

1 Versions

  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |