Skip to content

Don't recommend the use of import * as reducers. #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 25, 2015

Conversation

ghengeveld
Copy link
Contributor

Replaced the suggestion to use import * as reducers with the recommendation to use reducers/index.js and call combineReducers there. Updated the code examples accordingly.

As discussed here: #473

Replaced the suggestion to use `import * as reducers` with the recommendation to use `reducers/index.js` and call `combineReducers` there. Updated the code examples accordingly.
@gaearon
Copy link
Contributor

gaearon commented Aug 20, 2015

Thanks!

I suggest two tweaks:

  1. I'd change “the use of reducers/index.js” to something like “exporting a single reducer obtained using combineReducers() from reducers/index.js”.
  2. Let's move index.js after todos and counter are already declared so it's easier to trace what's going on.

@ghengeveld
Copy link
Contributor Author

Done.

#### `App.js`

```js
import { createStore, combineReducers } from 'redux';

import * as reducers from './reducers';
import reducer from './reducers/index';
console.log(reducers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log now can be removed

gaearon added a commit that referenced this pull request Aug 25, 2015
Don't recommend the use of `import * as reducers`.
@gaearon gaearon merged commit 5a61131 into reduxjs:master Aug 25, 2015
@ghengeveld ghengeveld deleted the patch-1 branch August 25, 2015 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants