title: Angular 6 call subscribe() for Observable multiple times
body: <p>I have two components: NewItemComponent and ListComponent. When I create new item inside corresponding component I notify ListComponent so it can refresh it's data model:</p>
  
  <pre><code>export class NewItemComponent implements OnInit {
  
    constructor(private itemService: ItemService, private notificationService: NotificationService) {
    }
  
    ngOnInit() {
    }
  
    createNewItem(item: Item) {
      this.itemService.persist(item).subscribe((response: Item) =&gt; {
        console.log(response);
        this.notificationService.notifyNewItemHasBeenCreated(response);
      });
    }
  }
  
  
  export class ListComponent implements OnInit {
  
    items: Item[];
  
    constructor(private listService: ListService, private notificationService: NotificationService) {
    }
  
    ngOnInit() {
      this.loadItems();
  
      this.notificationService.item$.subscribe((item) =&gt; {
        if (item != null) {
          this.loadItems();
        }
      })
    }
  
    loadItems(){
      this.istService.getItems().subscribe((data: Item[]) =&gt; {
        this.items= data;
        console.log(this.items);
      });
    }
  }
  
  
  @Injectable({
    providedIn: 'root'
  })
  export class NotificationService {
  
    private _item: BehaviorSubject&lt;Item&gt; = new BehaviorSubject&lt;Item&gt;(null);
    public  item$ = this._item.asObservable();
  
    constructor() {
    }
  
    notifyNewItemHasBeenCreated(item: Item) {
      this._item.next(item);
    }
  }
  </code></pre>
  
  <p>What makes me worried is that <strong>loadItems()</strong> calls <strong>subscribe()</strong> multiple times. Is this ok or there is better way to refetch items based on notification? </p>
  
  <pre><code>  loadItems(){
      this.listService.getItems().subscribe((data: Item[]) =&gt; {
        this.items= data;
        console.log(this.items);
      });
    }
  </code></pre>
  
  <p>ListService returns Observable:</p>
  
  <pre><code>export class ListService {
  
    basePath = 'my-api.com';
    apiPath = "item";
  
    constructor(private httpClient: HttpClient) {
    }
  
    getItems(): Observable&lt;Item[]&gt; {
      return this.httpClient.get&lt;Item[]&gt;(this.basePath + '/' + this.apiPath);
    }
  }
  </code></pre>
  
  <p>Thanks in advance and any help will be really appreciated.</p>