-
Notifications
You must be signed in to change notification settings - Fork 43
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
Ada Trader - Marisa Morris #48
base: master
Are you sure you want to change the base?
Conversation
Ada TraderWhat We're Looking For
|
@@ -0,0 +1,33 @@ | |||
import Backbone from 'backbone'; | |||
|
|||
const Order = Backbone.Model.extend({ |
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.
Since you're passing a Quote
instance to the Order
, you could listen for price changes,
Something like
initialize(params) {
this.listenTo(this.get('quote'), 'change', (quote) => {
// code to buy a quote, maybe a trigger to alert the view or quote.
}
},
buy() { | ||
// Implement this function to increase the price by $1.00 | ||
this.set('price', this.get('price') + 1.00); | ||
this.set('buy', true); |
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 what this accomplishes, quotes just represent the current price of a quote, why would there be a buy attribute?
'click button.btn-sell': 'addSellOrder', | ||
}, | ||
|
||
addBuyOrder: function(event) { |
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.
Could you merge addBuyOrder
and sellBuyOrder
?
Ada Trader
Congratulations! You're submitting your assignment!
Comprehension Questions