Sfoglia il codice sorgente

Merge pull request #203 from jtpio/value-changed-signal

Use the value.changed signal for the cell monitor
Johan Mabille 5 anni fa
parent
commit
b1b41742d1
1 ha cambiato i file con 8 aggiunte e 3 eliminazioni
  1. 8 3
      src/handlers/cell.ts

+ 8 - 3
src/handlers/cell.ts

@@ -1,12 +1,14 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import { Cell, CodeCell, ICellModel } from '@jupyterlab/cells';
+import { Cell, CodeCell } from '@jupyterlab/cells';
 
 import { CodeMirrorEditor } from '@jupyterlab/codemirror';
 
 import { ActivityMonitor } from '@jupyterlab/coreutils';
 
+import { IObservableString } from '@jupyterlab/observables';
+
 import { IDisposable } from '@phosphor/disposable';
 
 import { Signal } from '@phosphor/signaling';
@@ -135,7 +137,7 @@ export class CellManager implements IDisposable {
       }
 
       this._cellMonitor = new ActivityMonitor({
-        signal: this.activeCell.model.contentChanged,
+        signal: this.activeCell.model.value.changed,
         timeout: CELL_CHANGED_TIMEOUT
       });
 
@@ -261,7 +263,10 @@ export class CellManager implements IDisposable {
   private breakpointsModel: Breakpoints.Model;
   private _activeCell: CodeCell;
   private _debuggerService: IDebugger;
-  private _cellMonitor: ActivityMonitor<ICellModel, void> = null;
+  private _cellMonitor: ActivityMonitor<
+    IObservableString,
+    IObservableString.IChangedArgs
+  > = null;
 }
 
 export namespace CellManager {