meetio-room / Project-X

2 stars 1 forks source link

13/Apr/2018 Technical Code-Review notes #3

Open itspoma opened 6 years ago

itspoma commented 6 years ago
bohdanbirdie commented 6 years ago

const mapDispatchToProps = dispatch => bindActionCreators({ myAction, }, dispatch);

export default connect( mapStateToProps, mapDispatchToProps, )(test);


- [ ] There is a lot of places where your code is hard to read, most of them are a JSX code, so try to setup your text editor or IDE to auto-prettify code following eslint plugin rules.
- [x] Keep similar syntax everywhere, so adding semicolumns in one place require you to add it everywhere.
- [ ] Some of the containers are pretty big, like 250+ lines of code, this is because they contain too much is business logic, which has to be moved from components to actions. You can keep only internal login in components. For example - when you have a `Switch` component - there is no need to have an action for it, so it can be controlled by `state`, but the result of toggling have to be operated in actions and saved in store.
- [x] Local storage is case sensitive, so to avoid any issues - keep it in lower case with underscores `localStorage.removeItem('Events');`
- [x] Empty tags have to be self-closed `<span class="slider round"></span>`
- [x] Move API endpoint to config file `https://www.googleapis.com/calendar/v3` so it will be easy to update every HTTP call
- [x] Business logic is forbidden in reducers, so keep only store update code there
```JavaScript
case 'ERROR_HANDLER':
    {
      navigator.notification.alert(action.payload, null, 'Room Manager', 'OK'); // this is bad
      return state;
    }