this . paramGroup . valueChanges . pipe ( switchMap ( ( { searchText , numberOfItems } ) => this . api . fetch ( searchText , numberOfItems ) ) , takeUntil ( this . componentDestroyed$ ) ) . subscribe ( response => { } ) ;