瀏覽代碼

Add notes about the model behavior

Steven Silvester 9 年之前
父節點
當前提交
ef70e9bf8c
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/notebook/output-area/widget.ts

+ 8 - 0
src/notebook/output-area/widget.ts

@@ -108,6 +108,12 @@ const sanitizable = ['text/svg', 'text/html'];
 
 /**
  * An output area widget.
+ *
+ * #### Notes
+ * The widget model must be set separately and can be changed
+ * at any time.  Consumers of the widget must account for a
+ * `null` model, and may want to listen to the `modelChanged`
+ * signal.
  */
 export
 class OutputAreaWidget extends Widget {
@@ -263,6 +269,8 @@ class OutputAreaWidget extends Widget {
    * Handle a new model.
    *
    * #### Notes
+   * This method is called after the model change has been handled
+   * internally and before the `modelChanged` signal is emitted.
    * The default implementation is a no-op.
    */
   protected onModelChanged(oldValue: OutputAreaModel, newValue: OutputAreaModel): void { }