angular - ngrx not dispatching action in Observable.interval -


i've angular application using ngrx , want send action every x seconds, did this:

ngoninit() {     this.subscription = observable.interval(1000)       .do(() => this.store.dispatch(new loaddataaction()))       .subscribe();   } 

so should sending action every second. i'm ussing ngrx/effects intercept action , call service, works first time. it's subscription finished after first call.

if substitute action call service call works. doing wrong?

this @effects

@effect()   data$: observable<action> = this.actions$     .oftype(load_data_action)     .do(() => console.log('loaddataeffectservice'))     .switchmap(() => this.service.getdata())     .do(data => new dataloadedaction(data)); 

edit.

ok, got problem, last has map.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -