Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 1 | import {Component} from '@angular/core'; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 2 | import {NgRedux} from "@angular-redux/store"; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 3 | import {AppState} from "./shared/store/reducers"; |
| 4 | import '../style/app.scss'; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 5 | |
| 6 | @Component({ |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 7 | selector: 'vid-app', |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 8 | templateUrl: './app.component.html', |
| 9 | styleUrls: ['./app.component.scss'], |
| 10 | }) |
| 11 | export class AppComponent { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 12 | constructor(private store: NgRedux<AppState>) { |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 13 | store.subscribe(()=>{ |
| 14 | sessionStorage.setItem('reduxState', JSON.stringify(store.getState())); |
| 15 | }); |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 16 | } |
| 17 | } |