title: keep angular 8 toast/snackbar alive for long running task
body: <p>I have implemented angular 8 snack bar using the default snackbar in angular. However I have an excel extraction happening on the server that i would like to report its progress...I am implementing signalR to send the progress to the client, but not sure how to keep the snackbar alive to show the message (without recreating the snackbar). I was able to achieve it in angularjs using a toaster. Any advice on how to achieve this?</p>
  
  <pre class="lang-js prettyprint-override"><code>constructor(    
      private _snackBar: MatSnackBar,
      private _ngZone: NgZone) 
      {}
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>  public startConnection() {
  
      this.hubConnection = new signalR.HubConnectionBuilder()
        .withUrl("https://localhost:5001/Signal").build();
  
      this.hubConnection.start().then(() =&gt; {      
        this._snackBar.open("connection started");
      }).catch(err =&gt; console.log(err));
  
      this.hubConnection.onclose(() =&gt; {
        setTimeout(() =&gt; {
          this.hubConnection.start().then(() =&gt; {
            console.log("connection started");
          }).catch(err =&gt; console.log(err));
        }, 5000);
      });
  
      this.hubConnection.on("clientMethodName", (data) =&gt; {
  
        this._snackBar.open('Data returned from server '+ data);
        console.log(data);
      });
  
      this.hubConnection.on("WelcomeMethodName", (data) =&gt; {
  
        console.log(data);
        this.hubConnection.invoke("GetDataFromClient", data).catch(err =&gt; console.log(err));
      });   
    }
  </code></pre>