I have this in one of my components:
public booleanSubject: BehaviorSubject<boolean> = new BehaviorSubject(false);
When I add "strictFunctionTypes": true to the tsconfig.json file I get the following error:
× Compiling TypeScript sources through NGC
ERROR: path/to/my/component.component.ts:28:10 - error TS2322: Type 'BehaviorSubject<false>' is not assignable to type 'BehaviorSubject<boolean>'.
Types of property 'observers' are incompatible.
Type 'Observer<false>[]' is not assignable to type 'Observer<boolean>[]'.
Type 'Observer<false>' is not assignable to type 'Observer<boolean>'.
Type 'boolean' is not assignable to type 'false'.
28 public booleanSubject: BehaviorSubject<boolean> = new BehaviorSubject(false);
Does anyone know the reason and how to get it not to throw the error by keeping the strictFunctionTypes flag set to true?