Created
July 12, 2022 05:38
-
-
Save yharaskrik/63a178b0561f4a867e20458f7db0d83c to your computer and use it in GitHub Desktop.
component store 14.0.1 typing issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SomeType { | |
name: string; | |
prop: string; | |
} | |
export abstract class MyStore< | |
QueryVariables extends SomeType | |
> extends ComponentStore<any> { | |
protected abstract readonly query$: Observable<Omit<QueryVariables, 'name'>>; | |
readonly load = this.effect( | |
(origin$: Observable<Omit<QueryVariables, 'name'> | null>) => origin$ | |
); | |
protected constructor() { | |
super(); | |
} | |
protected initializeLoad() { | |
this.load(this.query$); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where as this works:
If I use the type directly instead of the generic to type the observable it passes type checking totally fine.