I am working on an Angular 7 application that deals with a total of 20 sensor data. My goal is to receive data from a selected sensor every 5 seconds using observables. For example:
var sensorId = ""; // dynamically chosen from the web interface
var sensorData$ = interval(5000).pipe()
sensorData$.subscribe() // etc..
I will be selecting multiple sensors and initiating data retrieval via subscription using intervals. How can I manage these observables effectively? What's the best approach to handle them?
In addition, I have the capability to add any new sensor at any given time.