title: Angular - pusher service creating multiple instances when hitting back, then forward in browser
body: <p>When I hit the back button in the browser, then forward to go back to my component it seems that the pusher service is adding an extra instance and in my case creating duplicate toastr notification messages. </p>
  
  <p>Pusher Service</p>
  
  <pre><code>@Injectable()
  export class PusherService {
      channel: any;
      pusher: any;
  
    constructor(private http: HttpClient) {
       this.pusher = new Pusher('123456', {
          cluster: 'us2',
          encrypted: true
        });
      this.channel = this.pusher.subscribe('my-channel');
     }
  </code></pre>
  
  <p>myComponent.ts</p>
  
  <pre><code>ngOnInit(){ 
  
  this.pusherService.channel.bind('my-event', data =&gt; {
          this.message = true;
          if(data){ 
            this.toastr.success(data.message.NoteContent ,'Note from: ' + data.message.Author  + ' - ' + data.message.Number, {dismiss: 'click'})
            .then((toast: Toast) =&gt; {
  
            })
  </code></pre>
  
  <p>Web API </p>
  
  <pre><code> [System.Web.Http.Route("api/Upload/CreateExternalNote")]
          [System.Web.Http.HttpPost]
          [System.Web.Http.AllowAnonymous]
          public async Task&lt;IHttpActionResult&gt; CreateExternalNoteAsync([FromBody]ExternalNote externalNote)
          {
             try
              {
                  if (!ModelState.IsValid)
                  {
                      return BadRequest(ModelState);
                  }
                var upload = context.Upload.FirstOrDefault(x =&gt; x.UploadId == externalNote.UploadId);
                if (upload != null)
                  upload.ExternalNoteReadCount = context.Upload.Where(x =&gt; x.UploadId == externalNote.UploadId)
                    .Select(x =&gt; x.ExternalNoteReadCount + 1).FirstOrDefault();
                var options = new PusherOptions
                  {
                    Cluster = "us2",
                    Encrypted = true
                  };
  
                  var pusher = new Pusher(
                    "123456",
                    "asdf234234",
                    "12342sadfasd33",
                    options);
                  var result = await pusher.TriggerAsync(
                    "my-channel",
                    "my-event",
                    new { message = externalNote });
                context.ExternalNote.Add(externalNote);
                  context.SaveChanges();
                  return Ok("Success");       
              }
              catch (Exception e)
              {          
              }     
      }
  </code></pre>