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

@Injectable({
  providedIn: 'root'
})
export class DataService {
  constructor() { }
  private message: string | undefined;

  getMessage(): string | undefined {
    return this.message;
  }

  setMessage(value: string): void {
    this.message = value;
  }

  private querySource = new BehaviorSubject<any>(null);
  currentQuery$ = this.querySource.asObservable();

  updateQuery(query: any): void {
    this.querySource.next(query);
  }
}
