import { DriveMetadata } from '../util/googleDriveUtils' ; import { FileAPI } from '../util/fileUtils' ; class MetadataLoaderService { private loading : { [ id ] : Promise < DriveMetadata > ; } = { } ; loadMetadata ( metadataId , fileAPI ) { if ( ! this . loading [ metadataId ] ) { this . loading [ metadataId ] = fileAPI . getFullMetadata ( metadataId ) ; } return this . loading [ metadataId ] ; } } export default new MetadataLoaderService ( ) ;