UNPKG

fabric8-planner

Version:
45 lines 2.31 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { Injectable } from '@angular/core'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { Observable } from 'rxjs'; import { catchError, map, switchMap } from 'rxjs/operators'; import * as InfotipActions from './../actions/infotip.actions'; import { InfotipService } from './../services/infotip.service'; import { ErrorHandler } from './work-item-utils'; var InfotipEffects = /** @class */ (function () { function InfotipEffects(actions$, infotipService, errHandler) { var _this = this; this.actions$ = actions$; this.infotipService = infotipService; this.errHandler = errHandler; this.getInfotips$ = this.actions$ .pipe(ofType(InfotipActions.GET), switchMap(function (action) { return _this.infotipService.getInfotips() .pipe(map(function (payload) { return new InfotipActions.GetSuccess(payload); }), catchError(function (err) { return _this.errHandler.handleError(err, 'Problem in fetching InfoTips', new InfotipActions.GetError()); })); })); } InfotipEffects.decorators = [ { type: Injectable }, ]; /** @nocollapse */ InfotipEffects.ctorParameters = function () { return [ { type: Actions, }, { type: InfotipService, }, { type: ErrorHandler, }, ]; }; __decorate([ Effect(), __metadata("design:type", Observable) ], InfotipEffects.prototype, "getInfotips$", void 0); return InfotipEffects; }()); export { InfotipEffects }; //# sourceMappingURL=infotip.effects.js.map