-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pipes - Irene & Lindsey - VideoStore #20
base: master
Are you sure you want to change the base?
Conversation
Save movie
adding search bar
Model validations
Validations
Video Store ConsumerWhat We're Looking For
|
addToCollection(attributes) { | ||
const newMovie = new Movie(attributes); | ||
if (newMovie.isValid()) { | ||
const movieView = new MovieView({ |
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.
Instead of creating a MovieView
here and appending its HTML directly to the DOM, it would probably make more sense to add the newMovie
to the movie list. That would trigger an update
event, which would be handled by render
, resulting in the same thing.
Aside from being DRYer, the fact that you don't add the movie to the list here means that if this view re-renders for some other reason, the newly added movie will be absent.
Video Store Consumer
Congratulations! You're submitting your assignment!
Comprehension Questions