Ngrx Store, Effects, Http Ajax Polling Setup on Angular 2
I'm creating an Ngrx Angular 2 app and was trying to get my http calls to continue polling after a time interval. I have seen the use of the interval() function, but in case of Ngrx, when service calls are done inside @Effect() , it gives an error. Please advise: @Injectable() export class TasksEffects { constructor( private actions$: Actions, private TS: TaskService ){} @Effect() onLoadTasksLoadTasks$: Observable<Action> = this.actions$.ofType(tasksActions.ActionTypes.LOAD_TASKS) .switchMap(() => { return this.TS.index() .map((res) => new tasksActions.LoadTasksSuccessAction(res.json()))