-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Allow passing an error on exit #165
Allow passing an error on exit #165
Conversation
Why do you need to pass the error to |
You need to update https://github.com/vadimdemedes/ink/blob/master/index.d.ts |
f58669f
to
07ff24b
Compare
That seems like a larger issue to solve than this. I'm not sure how to add the plumbing to handle that unless React does a bunch of that work for us. |
That's actually a good idea. We already have an |
I dig it. I'd be willing to address that in a separate PR. |
07ff24b
to
1b7834c
Compare
Updated. |
@sindresorhus I made that change. The |
1b7834c
to
763860f
Compare
Minor adjustment made: I updated the test case to use the error object for |
Thanks @mAAdhaTTah, great work! |
Could you fix the merge conflict, so that we can get it to master? ;) |
Passing a result to `exit` will cause `waitUntilExit` to reject with the value as the error. Fixes vadimdemedes#163.
763860f
to
6980f8b
Compare
Resolved. |
Thanks @mAAdhaTTah, I will take another look tomorrow and merge it! |
@vadimdemedes Not to be a pain, but a release with this fix + #170 would be really helpful for the CLI I'm working on. Thanks! |
@mAAdhaTTah Sorry for the delay, I pushed some big changes in the core and wanted to give people a few a days to test them out. Going to release in a few minutes ;) |
New release is out - https://github.com/vadimdemedes/ink/releases/tag/v2.1.0 🎆 |
No worries, thank you! |
* Allow passing an error on exit Passing a result to `exit` will cause `waitUntilExit` to reject with the value as the error. Fixes vadimdemedes#163. * Update readme.md
Passing a result to
exit
will causewaitUntilExit
to rejectwith the value as the error.
Fixes #163.