import {Injectable} from'@angular/core';
import {Subject} from 'rxjs';

@Injectable()
export class FileService {
    private imageSource = new Subject<string>();
    imageSourceAnnounced$ = this.imageSource.asObservable();

    private imageUrlMapa = new Subject<string>();
    imageUrlMapaAnnounced$ = this.imageUrlMapa.asObservable();

    private imageUrlBanner = new Subject<string>();
    imageUrlBannerAnnounced$ = this.imageUrlBanner.asObservable();

    private imageUrlFoto = new Subject<string>();
    imageUrlFotoAnnounced$ = this.imageUrlFoto.asObservable();

    announceImageSource(img: string) {
        this.imageSource.next(img);
    }

    announceImageMapa(img: string) {
        this.imageUrlMapa.next(img);
    }

    announceImageBanner(img: string) {
        this.imageUrlBanner.next(img);
    }

    announceImageFoto(img: string) {
        this.imageUrlFoto.next(img);
    }
}
