import { Component , ViewEncapsulation } from '@angular/core' ; import { Lineup , Panel , Table , Menu } from '../components' ; import { DevToolsExtension , NgRedux , select } from 'ng2-redux' ; import { IAppState , IParty , ITables , IMenu , rootReducer , middleware , enhancers , } from '../store' ; import { Observable } from 'rxjs' ; import { LineupActions , TableActions } from '../actions' ; import { Orders } from '../components' ; import { placedOrders } from '../selectors/selectors' ; import { reimmutify } from '../store' ; const TEMPLATE = require ( './home.template.html' ) ; @ Component ( { selector : 'tb-home' , template : TEMPLATE , directives : [ Lineup , Panel , Table , Menu , Orders ] , encapsulation : ViewEncapsulation . None , styles : [ require ( '../styles/index.css' ) ] , } ) export class HomePage { @ select ( ) lineup$ : Observable < IParty > ; @ select ( ) tables$ : Observable < ITables > ; @ select ( ) menu$ : Observable < IMenu > ; @ select ( placedOrders ) placedOrders$ : Observable < any > ; constructor ( private _ngRedux , private _tableActions , private _lineupActions , private _devTools ) { const tools = _devTools . enhancer ( { deserializeState : reimmutify , } ) ; _ngRedux . configureStore ( rootReducer , { } , middleware , tools ? [ ... enhancers , tools ] : enhancers ) ; } } ;