Skip to content

Homework#2

Open
ZorianaPro wants to merge 1 commit intohaensl:masterfrom
ZorianaPro:zozo-homework
Open

Homework#2
ZorianaPro wants to merge 1 commit intohaensl:masterfrom
ZorianaPro:zozo-homework

Conversation

@ZorianaPro
Copy link
Collaborator

Create root reducer to combine reducers, create Login and Greeting components

@@ -0,0 +1,9 @@
import { combineReducers } from 'redux';
import appReducer from './components/App/reducer';
Copy link
Owner

@haensl haensl Apr 28, 2020

Choose a reason for hiding this comment

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

Looks all good Zozo :)
The only minor thing I would like to let you know: don't use the name Reducer in the state. If you import the reducer with the name of what it represents, your state will look nicer ;)

Example:

import app from './components/App/reducer';
import login from './components/Login/reducer';

export default combineReducers({
  app,
  login
});

This way, in the other components where you use state, it just reads nicer - e.g.

isLoggedIn =  useSelector(state => state.loginReducer.loggedIn);

becomes

isLoggedIn =  useSelector(state => state.login.loggedIn);

So, you did veeeery good! 👍 👍 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you @haensl
I totally agree with your recommendation
Also I will add more stuff, to practice!

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