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
The text was updated successfully, but these errors were encountered:
Javran
changed the title
makeHTTPDriver doesn't typecheck when passed two arguments
Returned value of makeHTTPDriver() doesn't typecheck when passed two arguments
May 29, 2021
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 run which calls the driver, and the types in @cycle/http are optimized to satisfy @cycle/run's typechecking when calling run.
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 @cycle/state that just uses the normal http driver. At the moment sadly do not have the time to change that repo.
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/http@15.4.0
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: