How to set a TimeOut after a value of an Observable?

  angular, typescript

So I have a DataService where I have two Observables. From the server, I get multiple objects and their materials that are saved into the Observables. Now I have the problem that all of the objects get shown at the same time, but I want to have a couple of seconds break between the objects.
Where can I set a TimeOut so they won’t be displayed at the same time.

if (this.data.subs==undefined) {    
          this.data.subs = this.data.currentMessage.subscribe((data) => {
            this.object = data; 
          });    

      if(this.data.subsMtl == undefined){
        this.data.subsMtl = this.data.currentMaterial.subscribe((data)=> {
          this.mtl = data;
          console.log(this.mtl);
          this.showObject();
          
        });
      }
    } 

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.