promises vs observables

Image
Promises : ⛔️Promises are suitable for single asynchronous operations like fetching data from an API.promises are suitable for handling a single asynchronous value or error. Observables : ⛔️Observables are ideal for handling streams of data, such as user input, WebSocket events, or HTTP responses, where multiple values might be emitted over time. Table Promises Observables Emit a single value at a time Emit multiple values over a period of time. Eager Execution: Promises are eager, meaning they start execution immediately after creation.Are not cancellable. Are lazy: they’re not executed until we subscribe to them using the subscribe() method. Don’t provide any operations Provide the map for forEach, filter, reduce, retry, and retryWhen operators.Leverage Rxjs with Observables ...