-
Notifications
You must be signed in to change notification settings - Fork 38
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
Project complete #12
base: master
Are you sure you want to change the base?
Project complete #12
Conversation
|
||
import '../styles/App.scss'; | ||
|
||
class App extends React.Component { | ||
constructor(){ | ||
super(); | ||
|
||
this.getMenu = this.getMenu.bind(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMenu gets called as a method and does not need binding as a result
|
||
const currentOrder = { | ||
total: this.state.currentOrder.total + foodItem[menuItem.id].totalPrice, | ||
items: Object.assign(this.state.currentOrder.items, foodItem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IT would be better to us Object.assign({}, this.state.currentOrder.items, foodItem)
as the current implementation mutates state
Great work. I would suggest keeping the order data structure simpler and just store |
No description provided.