|
@@ -1,6 +1,10 @@
|
|
// Copyright (c) Jupyter Development Team.
|
|
// Copyright (c) Jupyter Development Team.
|
|
// Distributed under the terms of the Modified BSD License.
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
|
|
|
|
+import {
|
|
|
|
+ utils
|
|
|
|
+} from '@jupyterlab/services';
|
|
|
|
+
|
|
import {
|
|
import {
|
|
Application
|
|
Application
|
|
} from 'phosphor/lib/ui/application';
|
|
} from 'phosphor/lib/ui/application';
|
|
@@ -22,19 +26,11 @@ type JupyterLabPlugin<T> = Application.IPlugin<JupyterLab, T>;
|
|
*/
|
|
*/
|
|
export
|
|
export
|
|
class JupyterLab extends Application<ApplicationShell> {
|
|
class JupyterLab extends Application<ApplicationShell> {
|
|
- /**
|
|
|
|
- * Create a new JupyterLab instance.
|
|
|
|
- */
|
|
|
|
- constructor() {
|
|
|
|
- super();
|
|
|
|
- this._startedPromise = new Promise(fn => { this._startedResolve = fn; });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* A promise that resolves when the JupyterLab application is started.
|
|
* A promise that resolves when the JupyterLab application is started.
|
|
*/
|
|
*/
|
|
get started(): Promise<void> {
|
|
get started(): Promise<void> {
|
|
- return this._startedPromise;
|
|
|
|
|
|
+ return this._startedDelegate.promise;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -45,7 +41,9 @@ class JupyterLab extends Application<ApplicationShell> {
|
|
return Promise.resolve(void 0);
|
|
return Promise.resolve(void 0);
|
|
}
|
|
}
|
|
this._startedFlag = true;
|
|
this._startedFlag = true;
|
|
- return super.start(options).then(() => { this._startedResolve(); });
|
|
|
|
|
|
+ return super.start(options).then(() => {
|
|
|
|
+ this._startedDelegate.resolve(void 0);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -55,7 +53,6 @@ class JupyterLab extends Application<ApplicationShell> {
|
|
return new ApplicationShell();
|
|
return new ApplicationShell();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private _startedDelegate = new utils.PromiseDelegate<void>();
|
|
private _startedFlag = false;
|
|
private _startedFlag = false;
|
|
- private _startedPromise: Promise<void> = null;
|
|
|
|
- private _startedResolve: () => void = null;
|
|
|
|
}
|
|
}
|