import { Injectable } from '@angular/core'
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'
import { Observable, of, EMPTY, forkJoin } from 'rxjs'
import { map, mergeMap, take, first } from 'rxjs/operators'

import { DataService } from '../../_services/data.service'
import { MeasuresItem } from '../../openapi'

@Injectable()
export class MeasuresListResolver  {
    constructor(
        protected dataService: DataService,
        private router: Router
    ) {}

    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<MeasuresItem[]> {
        return this.dataService.getList(route.paramMap.get('store'))
    }
}
