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

yield select() doesnt infere returned type #59

Open
mikeqcp opened this issue Mar 27, 2020 · 1 comment
Open

yield select() doesnt infere returned type #59

mikeqcp opened this issue Mar 27, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@mikeqcp
Copy link
Contributor

mikeqcp commented Mar 27, 2020

We should fix redux-saga typing to handle following case:
const foo = yield select(someSelectors.selectStringValue);

Currently yield select() doesnt infere selector type correctly and it always assumes foo: any

@mikeqcp mikeqcp added the bug Something isn't working label Mar 27, 2020
@mortigen
Copy link
Contributor

I think the easiest way to do it is to wrap select or to just use ReturnType of selector as foo value:

const foo: ReturnType<typeof someSelectors.selectStringValue> = yield select(someSelectors.selectStringValue);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants