Wiring tabs to update editor and handle closing of file view

This commit is contained in:
2025-06-02 00:10:56 -05:00
parent 04e3bbcc77
commit 0d1fdfa031
9 changed files with 86 additions and 22 deletions

View File

@@ -10,7 +10,10 @@ import { ServiceMessage } from '../../types/service-message.type';
})
export class EditorsService {
private messageSubject: ReplaySubject<ServiceMessage> = new ReplaySubject<ServiceMessage>(1);
private activationSubject: ReplaySubject<string> = new ReplaySubject<string>(1);
private activationSubject: ReplaySubject<string> = new ReplaySubject<string>(1);
private switchSessionSubject: ReplaySubject<string> = new ReplaySubject<string>(1);
private closeTabSubject: ReplaySubject<string> = new ReplaySubject<string>(1);
constructor() {}
@@ -30,4 +33,19 @@ export class EditorsService {
return this.activationSubject.asObservable();
}
setTabToEditor(data: string): void {
this.switchSessionSubject.next(data);
}
loadTabToEditor$(): Observable<string> {
return this.switchSessionSubject.asObservable();
}
closeTab(data: string): void {
this.closeTabSubject.next(data);
}
closeTabRequested$(): Observable<string> {
return this.closeTabSubject.asObservable();
}
}