Skip to content

Releases: erikras/multireducer

v3.1.0

23 Jan 08:53
Compare
Choose a tag to compare

v3.0.3

02 Dec 15:25
Compare
Choose a tag to compare
  • Add support for redux-thunk with extra argument #119 by Soulko

v3.0.2

20 Oct 13:29
Compare
Choose a tag to compare
  • Update of wrapDispatch to be backward compatible to v2 api #117 by @kovcic

v3.0.1

09 Oct 09:19
Compare
Choose a tag to compare
  • Use an action with an actual type to get the initialSate #115 by @yched

v3.0.0

14 Jul 03:38
Compare
Choose a tag to compare

This is a whole new rewrite version.

For the migration guide, please see https://github.com/erikras/multireducer/releases/tag/v3.0.0-beta2

v3.0.0-beta3

05 Jul 06:49
Compare
Choose a tag to compare
v3.0.0-beta3 Pre-release
Pre-release

Export wrapDispatch instead of wrapAction, you can use wrapDispatch to wrap redux's dispatch then dispatch action manually.

import { wrapDispatch } from 'multireducer'
import { add } from './actions/list'

wrapDispatch(dispatch, 'additional')(add)

v3.0.0-beta2

04 Jul 11:59
Compare
Choose a tag to compare
v3.0.0-beta2 Pre-release
Pre-release

This is a whole new rewrite version.

Breaking changes

  1. connectMultireducer has been removed, you can use react-redux's connect directly.
  2. multireducerBindActionCreators has been renamed to bindActionCreators.

Migration Guide

Version 2

import React, { Component, PropTypes } from 'react';
import { connectMultireducer } from 'multireducer';
import { add, remove } from './actions/list';

const mapStateToProps = (key, state) => ({ list: state.listCollection[key] });

const mapDispatchToProps = {add, remove};

ListComponent = connectMultireducer(
  mapStateToProps,
  mapDispatchToProps
)(ListComponent);

export default ListComponent;
render() {
  return (
    <div>
      <h1>Lists</h1>
      <ListComponent multireducerKey="proposed"/>
      <ListComponent multireducerKey="scheduled"/>
      <ListComponent multireducerKey="active"/>
      <ListComponent multireducerKey="complete"/>
    </div>
  );
}

Version 3

import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';  // <= use react-redux's connect directly
import { bindActionCreators } from 'multireducer';  // <= use multireducer's version of bindActionCreators
import { add, remove } from './actions/list';

const mapStateToProps = (state, { as }) => ({ list: state.listCollection[as] });  // <= access state by multireducer key

const mapDispatchToProps = (dispatch, { as }) => bindActionCreators({ add, remove }, dispatch, as); // <= pass multireducer key to bindActionCreators

ListComponent = connectMultireducer(
  mapStateToProps,
  mapDispatchToProps
)(ListComponent);

export default ListComponent;
render() {
  return (
    <div>
      <h1>Lists</h1>
       {/* you can name the multireducer key whatever you want, it's 'as' in this example */}
      <ListComponent as="proposed"/>
      <ListComponent as="scheduled"/>
      <ListComponent as="active"/>
      <ListComponent as="complete"/>
    </div>
  );
}

v2.0.0

26 Jan 17:20
Compare
Choose a tag to compare

Breaking Changes

v1.0.x

mapStateToProps() took the reducer's state as its only parameter.

v2.x

mapStateToProps() takes the reducer's key, the entire state, and an optional ownProps parameter, much like react-redux's connect() function.

For more details, see PR #103 and the README.

This is how the react-redux-universal-hot-example was migrated.

v1.0.2

15 Oct 15:41
Compare
Choose a tag to compare

☑️ Added support for react-redux@4.0.0 with peer dep.

v1.0.1

07 Oct 18:17
Compare
Choose a tag to compare

☑️ Updated peer dependency to include React 0.14