Skip to content

Invalid types for createEffect and attach in factories with generics #1069

@kireevmp

Description

@kireevmp

Invoking attach within factories with an unbounded type parameter causes an error when the effect in attach returns that type parameter.

image

}): FX extends (source: any, ...args: infer Args) => infer Done
? Effect<OptionalParams<Args>, AsyncResult<Done>>
: never

Reproduction (with error and proposed fix): https://tsplay.dev/NdbxdW
The Awaited type I used is available in TS since version 4.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoreeffector packagetypingsTypescript public type definitions issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions