Observables
Q1: What is the difference between an observable and a promise? =>The key differences are as follows: 1)Observable does not start untill subscription/subscribed, while Promises are executed immediately. 2)Observable provide many values while Promises provide one. 3)Observable subscription are cancellable while promise are not cancellable. 4)Observable provide operators to transform data. We use pipe to chain operators and only subs We should use promises over Observables when we need single subcription on single event. Q2: What is the difference between an observable and a subject? =>Observable can unicast while subject is a multicast observable. It means Subject allows values to be multicasted to multiple observables. Q3: What are some of the angular apis that are using observables? =>http, EventEmitter, async pipe etc Q4: How would you cache an observable data? =>We can use create a service implementing Replay subject. A replay subject can record given no of values and th...