title: Observable's subscribe triggered twice
body: <p>I've a problem with observable's subscribe. I've a <code>NotificationService</code> which I use for data transfer from the response any component to <code>NotificationComponent</code>. And now I need to get response from subscribe only <strong>one time</strong> but I get <strong>twice</strong>.</p>
  
  <p><strong>Here is my NotificationService:</strong></p>
  
  <pre><code>export class NotificationSharedService {
      private emitChangeSource = new Subject&lt;any&gt;();
      changeEmitted = this.emitChangeSource.asObservable();
  
      emitChange(change: any) {
          console.log(change);
          this.emitChangeSource.next(change);
      }
  
      getData(): Observable&lt;any&gt; {
          return this.changeEmitted;
      }
  }
  </code></pre>
  
  <p><strong>From here I send current status for <code>NotificationComponent</code>:</strong></p>
  
  <pre><code>const setDefaultImageRequest = this.images.defaultImage(id_image)
      .map((data: ResponseService) =&gt; {
          return Image.createFromObject(data.data);
      })
      .subscribe((data) =&gt; {
          console.log(data);
          this.defaultImage.id = data.id;
          this.propertyGalleryStatus = true;
          const status = {
              'message': 'Изображение по-умолчанию установлено успешно',
              'status': true
          };
          this.notificationShared.emitChange(status);
  
      }, (errors) =&gt; {
          console.log(errors);
          this.propertyGalleryStatus = true;
      });
  
      this.subscriptions.push(setDefaultImageRequest);
  </code></pre>
  
  <p><strong>Here is my <code>NotificationComponent</code> where I subscribe:</strong></p>
  
  <pre><code>constructor(public sharedData: NotificationSharedService) {
      const getSharedData = this.sharedData.getData().subscribe((data) =&gt; {
          console.log(data);
          this.status = false;
          this.statusError = false;
          this.state = true;
          if (data.internet_connection !== undefined) {
              if (!data.internet_connection) {
                  console.log(data);
                  this.message = this.messages.internet_error;
                  this.statusError = data.statusError;
                  console.log(this.message);
  
                  return;
              }
          }
  
          this.message = data.message;
          this.status = data.status;
          this.statusError = data.statusError;
  
          this.fadeNotification = setTimeout(() =&gt; {
              this.state = false;
              setTimeout(() =&gt; {
                  this.status = false;
              }, 5000);
              this.statusError = false;
          }, 4000);
      });
  
      this.subscriptions.push(getSharedData);
  }
  </code></pre>
  
  <p><strong>Here is response Where subscribe triggered twice:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/h0iFG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h0iFG.png" alt="enter image description here"></a></p>
  
  <p><strong>Here is screenshot where notification template triggered twice</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/aiIJY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aiIJY.png" alt="enter image description here"></a></p>
  
  <p><strong>Here is notification template</strong></p>
  
  <pre><code>&lt;div on-mouseover="hoverNotification()" on-mouseout="unhoverNotification()" [ngClass]="{sbNotificationActive: state, sbNotificationSuccess: status, sbNotificationFailure: statusError}" class="sb-notification"&gt;
  &lt;div class="sb-notification__wrapper"&gt;
      &lt;div class="sb-notification__box"&gt;
          &lt;span class="sb-notification__message"&gt;{{message}}&lt;/span&gt;
          &lt;a *ngIf="!linkStatus" role="button" (click)="reloadPage()" class="sb-notification__reload"&gt;Reload page&lt;/a&gt;
      &lt;/div&gt;
      &lt;div (click)="close()" class="sb-notification__close-button"&gt;
          &lt;i class="sb-notification__icon flaticon-cancel"&gt;&lt;/i&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>