What is Observable and How it is different from Promise.

Imgur

What is Observable and How it is different from Promise.

In this blog post, I will discuss Observable and Promise and their differences
Promise and Observable both are used for making the asynchronous request, but there are some differences.

Observable Promise
Observable emits multiple values over the period Emit Single Value
Observable is lazy means nothing happens until a subscription is made Not Lazy. As soon as Promise is made it executes
Observable is cancellable. You can cancel the Observable by unsubscribing it Not Cancellable

إرسال تعليق

Please do not post any spam link in the comment box😊

أحدث أقدم

Blog ads

CodeGuru