-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Returned value of makeHTTPDriver() doesn't typecheck when passed two arguments #970
Comments
Hi @Javran, could you share a bit more of the surrounding context where you are using this? In the vast majority of use cases, the driver function itself shouldn't be called directly, but it's Cycle.js |
@staltz I'm trying to have a working starter template project with typescript setup (btw frustratingly, there aren't many around and all of them are bitrot one way or another) and came across https://github.com/cyclejs-community/typescript-starter-cycle/blob/c47fbd5a3a54fe3f5627e4a0bbce86223b101b99/src/drivers/github.ts#L43 (which is the context here) while trying to update the dependencies to latest version. Admittedly I don't know much about cyclejs (yet!), so I'm just following the type to see what's going on. |
I've briefly looked over the code and the github source is not how one would write this today. Usually you would write a main wrapper similar to |
Code to reproduce the issue:
for
@cycle/http
:http = makeHTTPDriver()(request$, 'fooHttp')
Expected behavior:
This should typecheck.
Actual behavior:
This doesn't typecheck as
makeHTTPDriver()
returns a function expecting exactly one argument but passed two instead.Versions of packages used:
@cycle/[email protected]
For anyone come across this, my current workaround is to give drive a more accurate type:
The text was updated successfully, but these errors were encountered: