Switched to angular 5's built-in transfer state api

This commit is contained in:
Art Lowel
2018-02-01 13:17:59 +01:00
parent 1aebb4fb5b
commit 4fbceab1b9
21 changed files with 159 additions and 398 deletions

View File

@@ -13,7 +13,6 @@ import { TranslateService } from '@ngx-translate/core';
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
import { TransferState } from '../modules/transfer-state/transfer-state';
import { MetadataService } from './core/metadata/metadata.service';
import { HostWindowResizeAction } from './shared/host-window.actions';
import { HostWindowState } from './shared/host-window.reducer';
@@ -32,7 +31,6 @@ export class AppComponent implements OnInit {
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
@Inject(NativeWindowService) private _window: NativeWindowRef,
private translate: TranslateService,
private cache: TransferState,
private store: Store<HostWindowState>,
private metadata: MetadataService
) {
@@ -48,16 +46,6 @@ export class AppComponent implements OnInit {
}
}
ngAfterViewChecked() {
this.syncCache();
}
syncCache() {
this.store.take(1).subscribe((state: HostWindowState) => {
this.cache.set('state', state);
});
}
ngOnInit() {
const env: string = this.config.production ? 'Production' : 'Development';
const color: string = this.config.production ? 'red' : 'green';