Skip to content

concatLatestFrom throws type error when used with an array #4743

@bcherkezovtf

Description

@bcherkezovtf

Which @ngrx/* package(s) are the source of the bug?

operators

Minimal reproduction of the bug/regression with instructions

const a = of("a");
a.pipe(
    concatLatestFrom(() => [of(1), of(2), of(3)]),
    map((a) => {
        console.log(a);
    })
);

When I use concatLatestFrom with an array it awlays returns the following error:

Argument of type 'OperatorFunction<string, [string, ...number[]]>' is not assignable to parameter of type 'OperatorFunction<string, [string, number, number, number]>'.
  Type '[string, ...number[]]' is not assignable to type '[string, number, number, number]'.
    Target requires 4 element(s) but source may have fewer.ts(2345)```

### Expected behavior

Not to return the error.

### Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx: 18.1.1
Angular: 18.2.0
Node: v20.19.0
OS: MacOS Sequoia 15.2

### Other information

_No response_

### I would be willing to submit a PR to fix this issue

- [ ] Yes
- [ ] No

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