浏览代码

Update patterns tutorial

Steven Silvester 8 年之前
父节点
当前提交
26219c991a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      tutorial/patterns.md

+ 5 - 1
tutorial/patterns.md

@@ -74,7 +74,11 @@ the sender as the first argument, and contain a single second argument
 with the payload.  Signals should generally not be used to trigger the 
 "default" behavior for an action, but to allow others to trigger additional
 behavior.  If a "default" behavior is intended to be provided by another
-object, then a callback should be provided by that object.
+object, then a callback should be provided by that object.  Wherever possible
+as signal connection should be made with the pattern 
+`.connect(this._onFoo, this)`.  Providing the `this` context allows the
+connection to be properly cleared by `clearSignalData(this)`.  Using a
+private method avoids allocating a closure for each connection.
 
 
 ## Models