Top RxJS frequently asked interview questions.
What is RxJS
Q: What are the disadvantages of using RxJS?
A: The disadvantages are as follows -
- Debugging the code with observables is little difficult.
- As you start to use Observables, you can end up your full code wrapped under the observables.
A:The difference between BehaviourSubject and Observable -
|Observable is stateless||BehaviourSubject is stateful|
|Observable creates copy of data||BehaviourSubject shares data|
|Observable is unidirectional||BehaviourSubject is bidirectional|
A:The difference between Observables and Promises -
|Promises runs asynchronously and we get the return value only once.||Observables runs asynchronously and we get the return value multiple times|
|Promises are not lazy||Observables are lazy|
|Promises cannot be cancelled||Observables can be cancelled|
|Promises provide a single future value.||Observables provide multiple future values.|