I have a variable on a class called isLoading (boolean) with a default value of false. An action occurs (http request) and the variable is set to true. When the action completes, the variable is set back to false. How can i use RXjs to watch this variable?
this._dataSource = new HttpDataSource(this.service, this.paginator, this.sort, columns);
//this returns false since its before the action that has taken place
this.isListLoading = this._dataSource.isLoading;
What i want is something like this in RXjs
this._dataSource = new MCHTTPDataSource(this.takeThisFormService, this.paginator, this.sort, columns);
const intervalId = setInterval(()=>{
if( !this._dataSource.isLoading ){
this.isListLoading = false;
clearInterval( intervalId );
}
}, 250 );
Thoughts?