U
U
Urukhayy2017-07-24 17:48:12
Angular
Urukhayy, 2017-07-24 17:48:12

How to get asynchronous streams in Angular 2/4 using Observable and HTTP?

MEAN-stack. For example, there is an array of data on the server, which is updated simultaneously by several users from different clients. And, accordingly, on each client, when the data changes, you need to update them. How can this be organized automatically through an Observable? In order not to update on a timer, and so that the client himself understands that it's time to get a new portion? Is it possible? If not, then we could also use Promise. Give an example of a much-needed use of Observable in HTTP Angular, where a Promise cannot be dispensed with.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Negwereth, 2017-07-24
@Urukhayy

WebSocket should solve the issue of actual data push.

M
Maxim, 2017-07-25
@american6oy

I can’t understand what the problem is, if you subscribe to an observer, it will automatically listen for changes and send them to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question