Skip to content

Returned value of makeHTTPDriver() doesn't typecheck when passed two arguments #970

@Javran

Description

@Javran

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:

 const driver: ((stream: Stream<RequestInput>, name?: string) => HTTPSource) =
      (makeHTTPDriver() as any)
 http = driver(request$, 'fooHttp')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions