-
Notifications
You must be signed in to change notification settings - Fork 35
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
David Gridley React Cinema #12
base: master
Are you sure you want to change the base?
Conversation
…s to local storage
} | ||
|
||
receiveFavouritesInfo(id, favourite) { | ||
if ( |
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.
The logic in this function could be simplified. If you calculate the new favourites array for each condition and store in a variable, you can then set it in state and local storage after. It will save you having to repeat setState and localStorage.setItem
|
||
receiveFavouritesInfo(id, favourite) { | ||
if ( | ||
id === "add__to__favourites" && |
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.
I'd also say moving favourites up and down should be broken out into own functions to keep them shorter
|
||
render() { | ||
return ( | ||
<header className="header"> |
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.
good use of BEM
Good work. However the logic around favourites handling could be tidied up |
No description provided.