Encountering an issue while attempting to utilize a getter and setter in my service, resulting in the following error message:
Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures 2349
toggleNav(): void {
this.sidebarService.sidebarStatus.pipe(
concatMap((bool: boolean) => this.sidebarService.updateStatus(bool))
);
}
Despite researching on various SO pages, I have yet to come across a straightforward explanation for this error. Can someone provide a simple explanation of what this error signifies?
Below are the relevant setters and getters:
private _sidebarStatus = new BehaviorSubject<boolean>(true);
public get sidebarStatus(): Observable<boolean> {
return this._sidebarStatus.asObservable();
}
public set updateStatus(bool: boolean) {
this._sidebarStatus.next(bool);
}