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

@Injectable({
  providedIn: 'root'
})
export class SubjectService {
  private loginDetails = new BehaviorSubject<any>(null);
  private isLoggined = new BehaviorSubject<any>(null);
  private isLang = new BehaviorSubject<any>(null);

  sendLoginData(loginData: any) {
    this.loginDetails.next(loginData);
  }

  changeLang(langData: any) {
    this.isLang.next(langData);
  }

  getLangData(): Observable<any> {
    return this.isLang.asObservable();
  }

  getLoginData(): Observable<any> {
    return this.loginDetails.asObservable();
  }

  sendisLoggined(isLoggined: any) {
    this.isLoggined.next(isLoggined);
  }

  getisLoggined(): Observable<any> {
    return this.isLoggined.asObservable();
  }

}
