-
Notifications
You must be signed in to change notification settings - Fork 210
Feedback #8
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
Feedback #8
Conversation
Thank you! |
@@ -136,6 +138,8 @@ This allows us to create slightly modified shallow copies of other objects. When | |||
|
|||
Another benefit worth pointing out is that `Object.assign()` can cause accidents: if we forget to pass an empty object literal as the first argument for this use case, we end up mutating the object. With object spread, there is no way to accidentally mutate anything, since the pattern always acts as if an empty object was passed to `Object.assign` in the first position. | |||
|
|||
> Some of the above phrasing matches [our I/O 2018 talk](https://www.youtube.com/watch?v=mIWCLOftfRw) *exactly*! I love it. |
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.
Comes straight from your own comment here: https://github.com/mjavascript/mastering-modular-javascript/pull/4/files#diff-4271760ad3c0338ba0897714ab786a23R92 😅
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.
Nice to see you love your own wording! Hahaha. I had the same thing happen to me the other day, where I was like "this is a fantastic combination of words", and like 5 minutes later realized I had written it 😂
1. Async functions require a bit of understanding on top of being comfortable with promises, but they're easier to debug and often result in simpler code, plus they can be interspersed with synchronous functions rather easily as well; | ||
1. Iterators and generators are powerful tools, but there aren't many practical use cases for them, so we must consider whether we're using them because they fit our needs or just because we can. | ||
|
||
> there aren’t many practical use cases for them? [citation needed] I for one use iteration all the time. |
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.
True, it's mostly that often people use these new shiny things just because they can, changed to all that many
The introduction of a `class` keyword, paired with the React framework hailing classes as the go-to way of declaring stateful components, classes have helped spark some love for a pattern that was previously quite unpopular when it comes to JavaScript. In the case of React, the base `Component` class offers lightweight state management methods, while leaving the rendering and lifecycle up to the consumer classes extending `Component`. When necessary, the consumer can also decide to implement methods such as `componentDidMount`, which allows for event binding after a component tree is mounted; `componentDidCatch`, which can be used to trap unhandled exceptions that arise during the component lifecycle; among a variety of other soft interface methods. There's no mention of these optional lifecycle hooks anywhere in the base `Component` class, which are instead confined to the rendering mechanisms of React. In this sense, we note that the `Component` class stays focused on state management, while everything else is offered up by the consumer. | ||
The introduction of a `class` keyword, paired with the React framework hailing classes as the go-to way of declaring stateful components | ||
|
||
> I heard that React might be moving away from classes in the future. You might want to ping Dan Abramov before including this sentence. |
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.
Added "originally" [hailing classes]
No description provided.