Skip to content

The return type of the first function in R.pipeP should be a PromiseLike #361

Closed
@antogyn

Description

@antogyn

If the first function in R.pipeP doesn't return a Promise, it fails during execution, but the typings allow it.

e.g. the declared type :

declare function $<R1, R2>(fn1: () => PromiseLike<R1> | R1, fn2: (v: R1) => PromiseLike<R2> | R2): () => PromiseLike<R2>;

should be :

declare function $<R1, R2>(fn1: () => PromiseLike<R1>, fn2: (v: R1) => PromiseLike<R2> | R2): () => PromiseLike<R2>;

Alternatively, since the function signature in the doc is :

((a → Promise b), (b → Promise c), …, (y → Promise z)) → (a → Promise z)

even though the implementation allows functions that return simple values, maybe the typings should enforce Promises for every function? WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions