ing
This commit is contained in:
parent
10e14d5edb
commit
8f6bae5586
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaCrawlerInputItemService } from '../../../service/meta-crawler-input-item.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllByMetaCrawlerFailure,
|
||||
ActionType,
|
||||
} from './meta-crawler-input-item.action';
|
||||
import { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { of } from 'rxjs';
|
||||
import { Effect, Actions, ofType } from '@ngrx/effects';
|
||||
import { of, Observable } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap, withLatestFrom } from 'rxjs/operators';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
|
@ -24,28 +23,21 @@ export class Effects {
|
|||
|
||||
constructor(
|
||||
private actions$: Actions,
|
||||
private store$: Store<any>,
|
||||
private metaCrawlerService: MetaCrawlerService,
|
||||
) { }
|
||||
|
||||
@Effect()
|
||||
readAll$ = this.actions$.pipe(
|
||||
ofType(ActionType.ReadAll),
|
||||
withLatestFrom(this.store$.select(MetaCrawlerEntitySelector.selectAll)),
|
||||
exhaustMap(([action, results]) => {
|
||||
if (0 < results.length) {
|
||||
return of(new ReadAllSuccess(results));
|
||||
}
|
||||
|
||||
return this.metaCrawlerService
|
||||
exhaustMap(() =>
|
||||
this.metaCrawlerService
|
||||
.readAll()
|
||||
.pipe(
|
||||
map((result: MetaCrawler[]) => {
|
||||
return new ReadAllSuccess(result);
|
||||
}),
|
||||
catchError(error => of(new ReadAllFailure(error)))
|
||||
);
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaHistoryType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaHistoryTypeService } from '../../../service/meta-history-type.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-history-type.action';
|
||||
import { MetaHistoryType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaInfraType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaInfraTypeService } from '../../../service/meta-infra-type.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-infra-type.action';
|
||||
import { MetaInfraType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaInfraVendor, MetaInfraType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaInfraVendorService } from '../../../service/meta-infra-vendor.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllByMetaInfraTypeFailure,
|
||||
ActionType,
|
||||
} from './meta-infra-vendor.action';
|
||||
import { MetaInfraVendor, MetaInfraType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaInputType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaInputTypeService } from '../../../service/meta-input-type.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-input-type.action';
|
||||
import { MetaInputType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaMemberStatusService } from '../../../service/meta-member-status.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-member-status.action';
|
||||
import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaNoAuthProbeStatusService } from '../../../service/meta-noauth-probe-status.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-noauth-probe-status.action';
|
||||
import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbeArchitectureService } from '../../../service/meta-probe-architecture.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-architecture.action';
|
||||
import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbeOs } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbeOsService } from '../../../service/meta-probe-os.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-os.action';
|
||||
import { MetaProbeOs } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbePackage, MetaProbeOs } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbePackageService } from '../../../service/meta-probe-package.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllByOsFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-package.action';
|
||||
import { MetaProbePackage, MetaProbeOs } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbeStatusService } from '../../../service/meta-probe-status.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-status.action';
|
||||
import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbeTaskTypeService } from '../../../service/meta-probe-task-type.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-task-type.action';
|
||||
import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaProbeVersionService } from '../../../service/meta-probe-version.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-probe-version.action';
|
||||
import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorDisplayItemService } from '../../../service/meta-sensor-display-item.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllByCrawlerFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-display-item.action';
|
||||
import { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorDisplayMapping, MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorDisplayMappingService } from '../../../service/meta-sensor-display-mapping.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllMetaSensorItemKeyByDisplayItemFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-display-mapping.action';
|
||||
import { MetaSensorDisplayMapping, MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorItemKey, MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorItemKeyService } from '../../../service/meta-sensor-item-key.service';
|
||||
|
||||
import {
|
||||
|
@ -16,7 +18,6 @@ import {
|
|||
|
||||
ActionType,
|
||||
} from './meta-sensor-item-key.action';
|
||||
import { MetaSensorItemKey, MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorItemTypeService } from '../../../service/meta-sensor-item-type.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-item-type.action';
|
||||
import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorItemUnitService } from '../../../service/meta-sensor-item-unit.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-item-unit.action';
|
||||
import { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorItemService } from '../../../service/meta-sensor-item.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-item.action';
|
||||
import { MetaSensorItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaSensorStatusService } from '../../../service/meta-sensor-status.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-sensor-status.action';
|
||||
import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaVendorCrawlerSensorItemService } from '../../../service/meta-vendor-crawler-sensor-item.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllFailure,
|
||||
ActionType,
|
||||
} from './meta-vendor-crawler-sensor-item.action';
|
||||
import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
|
|||
import { of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
|
||||
|
||||
import { MetaVendorCrawler, MetaInfraVendor } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
import { MetaVendorCrawlerService } from '../../../service/meta-vendor-crawler.service';
|
||||
|
||||
import {
|
||||
|
@ -11,7 +13,6 @@ import {
|
|||
ReadAllByInfraVendorFailure,
|
||||
ActionType,
|
||||
} from './meta-vendor-crawler.action';
|
||||
import { MetaVendorCrawler, MetaInfraVendor } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class Effects {
|
||||
|
|
Loading…
Reference in New Issue
Block a user