Pipes - Sara Frandsen - Ada Trader#29
Open
frankienakama wants to merge 42 commits into
Open
Conversation
added 30 commits
December 12, 2017 15:44
…e tradeList was initialized)
added 12 commits
December 16, 2017 17:05
Ada TraderWhat We're Looking For
|
|
|
||
| bySymbol: function(symbol) { | ||
| const filtered = this.filter(function (quote) { | ||
| return quote.get('symbol') === symbol; |
There was a problem hiding this comment.
I like that you broke this out as a separate function on the collection. Good organization!
| initialize(params) { | ||
| this.buy = params.buy; | ||
| this.targetPrice = params.targetPrice; | ||
| this.symbol = params.symbol; |
There was a problem hiding this comment.
Backbone should copy all this data into the attributes automatically, which you can then access with this.get('targetPrice').
| initialize(params) { | ||
| this.symbol = params.symbol; | ||
| this.buy = params.buy; | ||
| this.price = params.price; |
There was a problem hiding this comment.
Again, should not need to explicitly copy attributes here.
| if (this.model.targetPrice < matchingQuote.attributes.price) { | ||
| matchingQuote.buy(); | ||
| this.bus.trigger('addTrade', trade); // newTrade() in trade_list_view | ||
| this.trigger('deleteOrder'); // deleteOrder() above ^^ |
There was a problem hiding this comment.
Why not call this.deleteOrder() directly?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ada Trader
Congratulations! You're submitting your assignment!
Comprehension Questions