Wiring tabs to update editor and handle closing of file view
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
@@ -2,4 +2,5 @@ export class ServiceMessage {
|
||||
action: string = "none";
|
||||
message: string = "";
|
||||
uuid!: string;
|
||||
data: any;
|
||||
}
|
Reference in New Issue
Block a user