switchMap(action =>
this.todosService.getTodos()
// If successful, dispatch success action with result
.map(todos => ({type: GET_TODOS_SUCCESS, payload: todos}))
// If request fails, dispatch failed action
.catch(() => Observable.of({type: GET_TODOS_ERROR})));