UI doesn't refresh after removing data from PouchDb


#1

I have getting data from PouchDB

getTodos(): Observable<any> {
    return Observable.from(
      this.db.allDocs({include_docs: true}).then((result) => {

        if(this.data) return this.data;

        this.data = [];

        result.rows.map((row) => {
          this.data.push(row.doc);
        });

        this.db.changes({live: true, since: 'now', include_docs: true}).on('change', (change) => {
          this.handleChange(change);
        });
        
        return this.data;
      })
    );
  }

And i have an intermediate service to filter this data

getFilteredTodos() {
    return this.todoDb.getTodos()
      .map(res => {
        return res.filter(item => item.title == '1' );
      });
  }

And the home page where i subscribe on this data and show the result

 ionViewDidLoad() {
    this.filteredTodo.getFilteredTodos()
      .subscribe(res => {
        this.todos = res;
      });
  }

So, after clicking on remove button nothing has change

But if i will not filter data everything will be good, ui refreshes…

  getFilteredTodos() {
        return this.todoDb.getTodos()
          .map(res => {
            return res;
          });
      }

#2

Hey Denz,
Did you ever get a solution to this? I have the same problem of the UI not updating after a deletion is carried out. I have to re-run the inititialization routine to re-get the data, but this has unexpected consequences (duplicates, for starters)
Did you find a workaround?
thanks!