@@ -4,13 +4,14 @@ import * as injectTapEventPlugin from 'react-tap-event-plugin';
44import { sideElement , SideRoot } from './components/SidePanel' ;
55import { topElement , TopRoot } from './components/TopPanel' ;
66import { loadPolyfills , render } from 'core-coderoad' ;
7- import { onActivate , onDeactivate } from './subscriptions' ;
7+ import Subscriptions from './subscriptions' ;
88import store from './store' ;
99import { setupVerify } from './modules/setup' ;
1010
1111class Main {
1212 side : HTMLElement ;
1313 top : HTMLElement ;
14+ subscriptions : any ;
1415 constructor ( ) {
1516 // remove later
1617 injectTapEventPlugin ( ) ;
@@ -22,6 +23,7 @@ class Main {
2223 // initialize element targets
2324 this . side = sideElement . init ( ) ;
2425 this . top = topElement . init ( ) ;
26+ this . subscriptions = new Subscriptions ;
2527 }
2628 activate ( ) : void {
2729 // create atom panels
@@ -35,15 +37,15 @@ class Main {
3537 } ) ;
3638
3739 // activate subscriptions
38- onActivate ( store ) ;
40+ this . subscriptions . onActivate ( store ) ;
3941
4042 // render React component
4143 ReactDOM . render ( SideRoot ( store ) , this . side ) ;
4244 ReactDOM . render ( TopRoot ( store ) , this . top ) ;
4345 }
4446 deactivate ( ) : void {
4547 // remove subscriptions & unmount react app
46- onDeactivate ( store ) ;
48+ this . subscriptions . onDeactivate ( store ) ;
4749 }
4850} ;
4951
0 commit comments