Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: withObservables does not properly check types #123

Open
larkox opened this issue Feb 21, 2022 · 0 comments
Open

Typescript: withObservables does not properly check types #123

larkox opened this issue Feb 21, 2022 · 0 comments

Comments

@larkox
Copy link

larkox commented Feb 21, 2022

Let a component like:

const myComponent = ({myList: string[]}) => {
    ...
}

If we pass a more general within withObservables, instead of typescript complaining, it appears as valid:

const wo = withObservables() => {
    const list: Observable<(string|number)[]> = ...
    return {myList: list}
}

Expected result:
Some error saying that types are not compatible, since the return type of withObservables ((string|number)[]) is not assignable to the props (string[]).

Some other examples:

  • Props: string, withObservables return: string|undefined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant