title: Angular multiple filtering Observable, rxJS
body: <p>Hello i want use 3x filter input <code>(1x input:text, 2x select)</code>. I have a Observable list <code>userList$: Observable&lt;User[]&gt;</code>. In <code>ngOnInit()</code> i filter this list use my <code>input:text</code>.</p>
  
  <pre><code>userList$: Observable&lt;User[]&gt;
  inputControl = new FormControl();  // input type text
  selectStatus = new FormControl();  // select
  filteredData$:any;
  
  ngOnInit(){
     this.filteredData$ = combineLatest(
        this.userList$,
        this.inputControl.valueChanges.pipe(
          startWith(""),
          debounceTime(400)
        )
      ).pipe(
        distinctUntilChanged(),
        filter(([list, input]) =&gt; Boolean(list)),
        map(([list, input]) =&gt; {
          return list.filter(
            ({login}) =&gt; !input || login.toLowerCase().indexOf(input) !== -1);
        })
      );  
      this.userList$ = this.filteredData$;
  }
  </code></pre>
  
  <p>When i add one more filter first filter not working.. Code when i use 2x filtered:</p>
  
  <pre><code>ngOnInit(){
      this.filteredData$ = combineLatest(
        this.userList$,
        this.inputControl.valueChanges.pipe(
          startWith(""),
          debounceTime(400)
        )
      ).pipe(
        distinctUntilChanged(),
        filter(([list, input]) =&gt; Boolean(list)),
        map(([list, input]) =&gt; {
          return list.filter(
            ({login}) =&gt; !input || login.toLowerCase().indexOf(input) !== -1);
        })
      );  
      this.filteredData$ = combineLatest(
        this.userList$,
        this.selectStatus.valueChanges.pipe(
          startWith(""),
          debounceTime(400)
        )
      ).pipe(
        distinctUntilChanged(),
        filter(([list, input]) =&gt; Boolean(list)),
        map(([list, input]) =&gt; {
          if(input == 1){
            return list.filter(
              ({is_banned, is_deleted}) =&gt;  is_banned !== 1 || is_deleted !== 1);
          }else if (input == 2){
            return list.filter(({is_banned}) =&gt; is_banned == 1 );
          }else{
            return list.filter(({is_deleted}) =&gt; is_deleted == 1 );
          }
        })
      );
      this.userList$ = this.filteredData$;
   }
  </code></pre>
  
  <p>How can i filtering this list when use 3x filter field?</p>