-
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 - Kee & Iuliia - Video Store Consumer #15
base: master
Are you sure you want to change the base?
Conversation
Video Store ConsumerWhat We're Looking For
|
|
||
if (this.mode == "search") { | ||
this.collection.forEach((movie) => { | ||
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.
We may have talked about this in person, but I'm not a big fan of the names model
and collection
for these instance variables. It would be very easy to get confused about which one is the rental library and which ones are movieDB results. Could you give them more descriptive names?
addtoLibrary() { | ||
let saved = this.model.save(); | ||
if (saved) { | ||
this.collection.add(this.model); |
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.
You should probably handle errors if the movie does not save.
let found = this.collection.where({overview: this.model.get('overview')}).length > 0; | ||
this.model.set('inInventory', found); | ||
|
||
this.bus.trigger('addToCollection', this.model); |
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'm not sure addToCollection
is a good name for this event, since you haven't added anything to a collection. Perhaps something like selectMovie
would be more mnemonic.
Video Store Consumer
Congratulations! You're submitting your assignment!
Comprehension Questions