ocket8888 commented on code in PR #6753:
URL: https://github.com/apache/trafficcontrol/pull/6753#discussion_r876246508


##########
experimental/traffic-portal/src/app/shared/tp-header/tp-header.service.ts:
##########
@@ -22,15 +21,31 @@ import {TpHeaderComponent} from 
"src/app/shared/tp-header/tp-header.component";
        providedIn: "root"
 })
 export class TpHeaderService {
-       private header?: TpHeaderComponent;
+       private readonly headerTitle: ReplaySubject<string>;
+       private readonly headerHidden: ReplaySubject<boolean>;
+
+       constructor() {
+               this.headerTitle = new ReplaySubject(1);
+               this.headerHidden = new ReplaySubject(1);
+               this.headerHidden.next(true);
+       }
+
+       /**
+        * Gets the header title.
+        *
+        * @returns Subject containing the header title.
+        */
+       public getTitle(): ReplaySubject<string> {
+               return this.headerTitle;
+       }

Review Comment:
   why not just make the property `public` instead of adding an identity 
function wrapper?



##########
experimental/traffic-portal/src/app/shared/tp-header/tp-header.service.ts:
##########
@@ -22,15 +21,31 @@ import {TpHeaderComponent} from 
"src/app/shared/tp-header/tp-header.component";
        providedIn: "root"
 })
 export class TpHeaderService {
-       private header?: TpHeaderComponent;
+       private readonly headerTitle: ReplaySubject<string>;
+       private readonly headerHidden: ReplaySubject<boolean>;
+
+       constructor() {
+               this.headerTitle = new ReplaySubject(1);
+               this.headerHidden = new ReplaySubject(1);
+               this.headerHidden.next(true);
+       }
+
+       /**
+        * Gets the header title.
+        *
+        * @returns Subject containing the header title.
+        */
+       public getTitle(): ReplaySubject<string> {
+               return this.headerTitle;
+       }

Review Comment:
   also applies to `getHidden`, obviously.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to