Angular 2 Observable with multiple subscribers

后端 未结 6 555
执笔经年
执笔经年 2020-12-04 13:07

I have an angular 2 service that fetch data from an API this service has 3 subscribers (defined in Components) each doing something else with the data (different graphs)

6条回答
  •  孤城傲影
    2020-12-04 13:39

    shareReplay should do it now - "(...) valuable in situations where you know you will have late subscribers to a stream that need access to previously emitted values."

提交回复
热议问题