import { Injectable } from '@angular/core' ; import { Store } from '@ngrx/store' ; import { Observable } from 'rxjs' ; import { of } from 'rxjs/observable/of' ; import 'rxjs/add/observable/forkJoin' ; import { ContractsService } from '../../shared/contracts.service' ; import { Web3Service } from '../../web3/web3.service' ; @ Injectable ( ) export class AssetsRequirementsService { constructor ( private store , private web3Service , private contractsService ) { } getAssetsRequirements ( ids ) { return Observable . forkJoin ( ids . map ( id => { return this . web3Service . callContract ( this . contractsService . AssetsRequirementsInstance . getRequirements , [ id ] ) . then ( ( result ) => { return result ; } ) ; } ) ) ; } }