@@ -14,7 +14,7 @@ import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry';
14
14
import { IRenderMimeRegistry } from '@jupyterlab/rendermime' ;
15
15
import { Contents , User } from '@jupyterlab/services' ;
16
16
import { CommandRegistry } from '@lumino/commands' ;
17
- import { Signal } from '@lumino/signaling' ;
17
+ import { ISignal , Signal } from '@lumino/signaling' ;
18
18
19
19
import { CollaborativeChatModel } from './model' ;
20
20
import { CollaborativeChatPanel } from './widget' ;
@@ -31,14 +31,29 @@ export class WidgetConfig implements IWidgetConfig {
31
31
* The constructor of the WidgetConfig.
32
32
*/
33
33
constructor ( config : Partial < IConfig > ) {
34
- this . config = config ;
35
- this . configChanged . connect ( ( _ , config ) => {
36
- this . config = { ...this . config , ...config } ;
37
- } ) ;
34
+ this . _config = config ;
35
+ }
36
+
37
+ /**
38
+ * Getter and setter for the config.
39
+ */
40
+ get config ( ) : Partial < IConfig > {
41
+ return this . _config ;
42
+ }
43
+ set config ( value : Partial < IConfig > ) {
44
+ this . _config = { ...this . _config , ...value } ;
45
+ this . _configChanged . emit ( value ) ;
46
+ }
47
+
48
+ /**
49
+ * Getter for the configChanged signal
50
+ */
51
+ get configChanged ( ) : ISignal < WidgetConfig , Partial < IConfig > > {
52
+ return this . _configChanged ;
38
53
}
39
54
40
- config : Partial < IConfig > ;
41
- configChanged = new Signal < this , Partial < IConfig > > ( this ) ;
55
+ private _config : Partial < IConfig > ;
56
+ private _configChanged = new Signal < WidgetConfig , Partial < IConfig > > ( this ) ;
42
57
}
43
58
44
59
/**
0 commit comments