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
Code error in the example explained in the API doc for "combineReducers" ? #1616
Comments
I'd say no. If you think about it, Redux only has a single reducer function. The fact that this example is using Also, note that when Finally, note that when you do function someFunction(a, fred, randomVariableName) {}
const firstVariable = 1;
const theMeaningOfLife = 42;
const aTotallyUselessName = "Whatever";
someFunction(firstVariable, theMeaningOfLife, aTotallyUselessName); Note how the variable names I define outside the function don't have to have any correspondence with the parameter names inside the function. Similarly, when exporting: // fileA.js
export default const aThing = 42;
// fileB.js
import iCanGiveThisAnyNameIWant from "fileA"; |
@markerikson Thank you for these great answers. |
Thank you very much @markerikson. I'm learning Redux to be used with JQuery, minus the knowledge of React. Your answer now helps me to better understand the examples with the React code. |
In the example described as part of API doc of "combineReducers", at the time of the store creation, "reducer" as a parameter is passed on to createStore in the file "app.js" (
let store = createStore(reducer)
).However in "reducers/index.js", the function name is "combineReducers" and not "reducer" (
export default combineReducers({..})
).So shouldn't the parameter pass on at the creation of the store be "combineReducers" (Eg:
let store = createStore(combineReducers
)) ??The text was updated successfully, but these errors were encountered: