Backbone.js bindの3番目の引数について

Backbone.js のbindの3番目の引数は何を渡すべきか?

http://backbonejs.org/#Events-on

onobject.on(event, callback, [context])Alias: bind 
Bind a callback function to an object. The callback will be invoked whenever the event is fired. If you have a large number of different events on a page, the convention is to use colons to namespace them: "poll:start", or "change:selection". The event string may also be a space-delimited list of several events...

book.on("change:title change:author", ...);
To supply a context value for this when the callback is invoked, pass the optional third argument: model.on('change', this.render, this)

Callbacks bound to the special "all" event will be triggered when any event occurs, and are passed the name of the event as the first argument. For example, to proxy all events from one object to another:

proxy.on("all", function(eventName) {
  object.trigger(eventName);
});
All Backbone event methods also support an event map syntax, as an alternative to positional arguments:

book.on({
  "change:title": titleView.update,
  "change:author": authorPane.update,
  "destroy": bookView.remove
});

on メソッド(bindはonメソッドのalias)の引数は

  • 第一引数:event・・イベントを識別する文字列(スペース区切りで複数登録可)
  • 第二引数:callback・・イベント発生後にコールバックするメソッド
  • 第三引数:context・・?

http://qiita.com/yuku_t/items/16b799d0ec0a0ae3f78e

Events に限らず、コールバック関数内では this が何を指すのか気をつける必要があります。 bind において、context を指定しなかった場合、コールバック関数内で this は Subject オブジェクトになります。(subject オブジェクトとはコール元のオブジェクト)

つまり

第三引数は、(callback後のthisが呼び出し元のオブジェクトと異なる場合は)callback後のthisとなるべきオブジェクトを指定する。

以下、trigger

http://backbonejs.org/#Events-trigger

triggerobject.trigger(event, [*args]) 
Trigger callbacks for the given event, or space-delimited list of events. Subsequent arguments to trigger will be passed along to the event callbacks.

トリガーは、与えられたイベント、または、スペースで区切られたイベントのリストをコールバックします。 トリガーに続く引数は、イベントのコールバックへ渡されます。