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

condition doesn't work with type guards #166

Closed
Tracked by #175
fsher opened this issue Sep 8, 2021 · 4 comments
Closed
Tracked by #175

condition doesn't work with type guards #166

fsher opened this issue Sep 8, 2021 · 4 comments
Labels
enhancement Improvement in existing feature
Milestone

Comments

@fsher
Copy link

fsher commented Sep 8, 2021

Hey there!

I've discovered that condition's if doesn't propagate type guarded types to else and then. When passing a union type in source return type and trying to type-guard it in if, else still has Unit<void | NoInfer<Foo | Bar>

Reproducible Example

Expected Result

  • else and then properties are type guarded by if, similar to effector's guard

Environment:

  • Effector: 22.1.0
  • Typescript: 4.3.5

Please let me know if you need more information regarding this. Thanks!

@fsher
Copy link
Author

fsher commented Sep 8, 2021

May be linked to #109

@sergeysova sergeysova added bug Something isn't working enhancement Improvement in existing feature and removed bug Something isn't working labels Sep 20, 2021
@sergeysova sergeysova mentioned this issue Nov 14, 2021
35 tasks
@sergeysova sergeysova added this to the v2.0 milestone Nov 14, 2021
@sergeysova
Copy link
Member

sergeysova commented Nov 26, 2021

@fsher Can you reproduce your example again, please? I can't see any issues

@ainursharaev
Copy link
Contributor

@fsher I've checked your example and also didn't get any issues

@fsher
Copy link
Author

fsher commented Jun 21, 2022

@sergeysova @ainursharaev hey guys. Sorry for a VERY late reply, and thank you for looking into this.

TS playground shows no errors for me as well at the moment. I'm assuming it's pulling the latest versions of packages by default (which I'm sorry I haven't configured properly or used a different sandbox). It might've been fixed in one of the releases after Sep 8, 2021, so I think we can freely close this with no-repro/fixed.

Again, sorry for a late reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement in existing feature
Projects
None yet
Development

No branches or pull requests

3 participants