sstorie / experiments

A repository to capture simple code experiments
140 stars 205 forks source link

Property 'asObservable' does not exist on type 'Store<IState>'. #25

Open rcadhikari opened 7 years ago

rcadhikari commented 7 years ago
ERROR in /..../..../auto-logout.service.ts (19,28): Property 'asObservable' does not exist on type 'Store<IState>'.
webpack: Failed to compile.
kriskumar70 commented 6 years ago

import { Observable } from 'rxjs/Observable'; import { Store } from '@ngrx/store';

import { IState } from '../store/application-state'; import { ACTIVITY_TIMEOUT_OCCURRED } from '../../app.reducer';

@Injectable() export class AutoLogoutService {

constructor(
    store: Store<IState>
) {
    // In our example we're treating any change in global state 
    //  as an example of user activity. So to start we need to
    //  just get an observable for the stream of state changes
    //

    // const state$ = store.asObservable() as Observable<IState>;
    // tslint:disable-next-line:prefer-const
    let state$: Observable<IState> ;