-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
refactor: イベントの用語の整理 #488
refactor: イベントの用語の整理 #488
Conversation
Deploy preview for js-primer ready! Built with commit f8313b4 |
この辺の用語は文中でももうちょっと説明口調でいれないと混乱しそう。 |
|
どこでイベントリスナー = イベントハンドラーをするか迷うな
TodoAppは必須だからTodoAppにはいれるか |
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.
/cc @lacolaco できたらレビューしてください。
@@ -1,52 +1,52 @@ | |||
export class EventEmitter { | |||
constructor() { | |||
// 登録する [イベント名, Set(ハンドラ)] を管理するMap |
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.
コードは大体コピーなのでスルーして大丈夫。
|
||
<!-- textlint-disable prh --> | ||
|
||
このようなイベントが発生した際に呼ばれるコールバック関数のことを**イベントリスナー**(イベントをリッスンするものという意味)と呼びます。またイベントリスナーはイベントハンドラーとも呼ばれることがありますが、この書籍ではこの2つの言葉は同じ意味として扱います。 |
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.
TodoAppでのイベントリスナーの初登場。
イベントハンドラーと同義と説明してる
Fix #455
やること
追記: #463 で議論して上の方針にまとめる。
イベントハンドラとイベントリスナーが混在してる(todoはイベントハンドラ、ajaxはイベントリスナー)ので、統一した方がいい気はする。
早わかり イベントモデル - 檜山正幸のキマイラ飼育記
おそらくこんな感じだとは思うんだけど、この書籍ではこの区別の必要性はないし、書いててもよくわからないので区別しないほうがいい気がする。
個人的には「イベントリスナーを呼び出す」よりも「イベントハンドラを呼び出す」と言いたいからハンドラになっている気がする。