Issue encountered with combineLatest following upgrade of rxjs from version 6.x to 7.x

Upon upgrading rxjs from version 6.6.6 to 7.4.0, an error surfaced in my combineLatest function.

searchQuery = new FormControl(null);
searchStatus = new FormControl<UserStatus>('ALL');

searchParams$ = combineLatest(
  this.searchQuery.valueChanges.pipe(startWith(null), debounceTime(200)),
  this.searchStatus.valueChanges.pipe(startWith('ALL')),
  (query: string, status: string) => {
    return { query, status };
  }
);

Here is the error message:

No overload matches this call. The last overload gave the following error. Argument of type '(query: string, status: string) => { query: string; status: string; }' is not assignable to parameter of type 'SchedulerLike'.

Answer №1

The function combineLatest now has an updated signature:

export function combineLatest<B extends readonly unknown[]>(sources: readonly [...ObservableInputTuple<B>]): Observable<B>;

Here's an example of how your new code might look:

params$ = combineLatest([
    this.param1.valueChanges.pipe(startWith(undefined), debounceTime(150)),
    this.param2.valueChanges.pipe(startWith('DEFAULT')),
])
    .pipe(
        map(([value1, value2]: [string | undefined, string]) => {
            return { value1, value2 };
        }));

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the proper way to tap into the features provided by DefinitelyTyped in typescript?

While working on my Angular2 app that deals with money amounts, I decided to use dinero.js to handle money values. However, I am encountering difficulties in accessing certain features in Typescript. Following the instructions, I installed the DefinitelyT ...

Remove all input fields within an HTML file using a TypeScript method implemented in an Angular 2 component

Within my Angular project, there are several input elements in the HTML file that are not enclosed within a form tag. I am looking to create a function in the TypeScript file that will clear all of these inputs. I attempted to utilize ViewChild, but it a ...

Add a React component to the information window of Google Maps

I have successfully integrated multiple markers on a Google Map. Now, I am looking to add specific content for each marker. While coding everything in strings works fine, I encountered an issue when trying to load React elements inside those strings. For ...

Dynamic Angular form with nested elements

Need help creating a nested form following the example from angular.io documentation: https://stackblitz.com/angular/pbdkbbnmrdg The objective is to include two DropdownQuestion elements from question.service.ts within a child formgroup called "details", ...

Angular: using the filter pipe to render HTML content

When using the pipe, I encounter an issue where the css is not being applied to highlight the searched words in a list. Instead of displaying the yellow background for the searched words, it outputs and displays the tag below: <span class='highlig ...

Whenever I attempt to launch the application on my device, an error message stating "plugin_Not_Installed Exception" occurs

I encountered a plugin_Not_Installed Exception when running the app on my device. Here are the details of my Ionic setup: Ionic: Ionic CLI : 5.4.16 Ionic Framework : @ionic/angular 6.2.2 @angular-devkit/build-angular : 1 ...

"From time to time, reimport React when saving to ensure all necessary imports are

When working with TypeScript in *.tsx files, particularly when copying code around, I frequently encounter the issue of an additional import line being added. This can be seen below: import React from "react"; // ? On Save "editor ...

Exploring nested grandchildren components in Angular2 Dart

Currently, I am attempting to make the following code work in Angular2 Dart: <div class='test'> <accordion2> <accordion-item-2 title="blah" active="true"> <sample-form-1></sample ...

Error: No default Firebase App named '[DEFAULT]' exists. Please remember to call Firebase App.initializeApp() to create the app (app/no-app). This issue is located at the app

Currently, I am in the process of learning how to integrate Firebase Functions into an Ionic + Angular project. My goal is to develop a custom function that retrieves all games from a collection and returns an array sorted by the "count" attribute. Initia ...

Updating the text of a Mat-Label dynamically without the need to reload the page

In my application, there is a mat-label that shows the Customer End Date. The end date is fetched initially through a GET request to an API. Let's say the end date is 16-05-2099, which is displayed as it is. There is also a delete button implemented f ...

Conduct surveillance on the service function call within the constructor

I am currently facing a challenge with trying to monitor a service function call that is executed in the constructor. The test is straightforward, simply aiming to confirm that the function call is indeed made. beforeEach(async(() => { TestBed.con ...

Display Bootstrap Modal using Typescript in Angular

Looking for some creative ideas here... My Angular site allows users to register for events by filling out a form. They can also register themselves and other people at the same time. https://i.sstatic.net/a44I7.png The current issue ~ when a user clicks ...

Tips for Fixing Error: "We received a visitor for node type TSSatisfiesExpression that is not recognized as a valid type."

There seems to be an issue with Babel unable to compile my Storybook code. I'm working on setting up a boilerplate with Storybook and Next.js I've searched for a solution to this problem but couldn't find one. Any help would be greatly app ...

The process of HTML compilation is halted due to the unexpected presence of the forbidden 'null' data type, despite the fact that null cannot actually be a valid value in

Encountering an issue with my HTML code, where the compiler stops at: Type 'CustomItem[] | null | undefined' is not compatible with type 'CustomItem[] | undefined'. Type 'null' cannot be assigned to type 'CustomItem[] ...

The 'ObjectID' property is not present in the 'CollectionStatic' data type

Encountering an issue with the MongoDB npm module: mongoId = new Mongo.Collection.ObjectID()._str; Attached is a screenshot for reference. Appreciate any assistance.https://i.sstatic.net/EHdMo.png ...

Navigating through Angular2 notifications using router chaining

I am currently working on a simple application form where, upon submission, the user is redirected to another page. My goal is to display a success message when the submit button is clicked. The code snippet below functions as expected, but there is an is ...

Angular implementing a carousel feature using the ngFor directive

Currently, I am working on implementing a carousel feature. The images in the carousel are sourced from a string array and I want to be able to cycle through them when clicking on the left or right arrows. How can I achieve this functionality using only ...

Customizing the appearance of antd Button using emotion and typescript

I've been attempting to customize an antd Button component using emotion in TypeScript, but I encountered an error when trying to implement the styled Button. The error message I received was: Type '{ children: never[]; }' is not assignab ...

Angular - Display shows previous and current data values

My Angular application has a variable called modelResponse that gets updated with new values and prints them. However, in the HTML, it also displays all of its old values along with the new ones. I used two-way data binding on modelResponse in the HTML [( ...

Typescript excels at gracefully handling cases where an element is not found

While working with Typescript-Protractor Jasmine, I encountered an issue where the test case (the 'it' block) is not failing when an element is not found. Instead, it shows an UnhandledPromiseRejectionWarning but still marks the script as passed. ...