UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2// Copyright (c) Jupyter Development Team.
3// Distributed under the terms of the Modified BSD License.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.BaseManager = void 0;
6const signaling_1 = require("@lumino/signaling");
7const serverconnection_1 = require("./serverconnection");
8class BaseManager {
9 constructor(options) {
10 var _a;
11 this._isDisposed = false;
12 this._disposed = new signaling_1.Signal(this);
13 this.serverSettings =
14 (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
15 }
16 /**
17 * A signal emitted when the delegate is disposed.
18 */
19 get disposed() {
20 return this._disposed;
21 }
22 /**
23 * Test whether the delegate has been disposed.
24 */
25 get isDisposed() {
26 return this._isDisposed;
27 }
28 /**
29 * Whether the manager is active.
30 */
31 get isActive() {
32 return true;
33 }
34 /**
35 * Dispose of the delegate and invoke the callback function.
36 */
37 dispose() {
38 if (this.isDisposed) {
39 return;
40 }
41 this._isDisposed = true;
42 this._disposed.emit(undefined);
43 signaling_1.Signal.clearData(this);
44 }
45}
46exports.BaseManager = BaseManager;
47//# sourceMappingURL=basemanager.js.map
\No newline at end of file