You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It is unsure ts-pattern support for promise handlers, because neither on the GIF, on README nor issues mentioning promise handler.
so I tried it myself,
its work, the result typing also resulting as expected, exhaustive work as expected. https://stackblitz.com/edit/typescript-qcrlpv?file=index.ts
Describe the solution you'd like
A clear guide on README.md that the handler can be promise too.
Describe alternatives you've considered
No alternative
Additional context
I like ts-pattern as it's simpler than conventional if branches (for some use case that has complex conditional branches).
I like to make a PR to update README.md and add example too about this.
The text was updated successfully, but these errors were encountered:
I've only done some limited testing with 5.0.6, but it seems like you may need to use .exhaustive or otherwise to make this work.
You can repro on the linked example, removing the exhaustive will show warnings 'await' has no effect on the type of this expression.(80007). Which is probably fine, would be worth a note if this gets added to the README.
Is your feature request related to a problem? Please describe.
It is unsure ts-pattern support for promise handlers, because neither on the GIF, on README nor issues mentioning promise handler.
so I tried it myself,
its work, the result typing also resulting as expected, exhaustive work as expected.
https://stackblitz.com/edit/typescript-qcrlpv?file=index.ts
Describe the solution you'd like
A clear guide on README.md that the handler can be promise too.
Describe alternatives you've considered
No alternative
Additional context
I like ts-pattern as it's simpler than conventional if branches (for some use case that has complex conditional branches).
I like to make a PR to update README.md and add example too about this.
The text was updated successfully, but these errors were encountered: