Why we should use RxJs of() function?
问题 in service section of angular.io tutorial for angular2 I hit a method named of.for example : getHeroes(): Observable<Hero[]> { return of(HEROES); } or in below sample: getHero(id: number): Observable<Hero> { // Todo: send the message _after_ fetching the hero this.messageService.add(`HeroService: fetched hero id=${id}`); return of(HEROES.find(hero => hero.id === id)); } in angular.io Just explained used RxJS of() to return an Observable of mock heroes (Observable). and It was not explained