I am using RxJS
and I can see there are 2 function in RxJS 5.5.2
available. Is the .finally
will be removed and it will be placed in side pipe()
from RxJS 6.0.0
on wards is the reason or there are any other changes?
Are they both same and now final call is inside pipe()
?
Or they have any notable difference?
method()
.pipe(
finalize(() => {
// do some operation
})
)
method()
.finally(() => {
// do your operation
})
Both are same functionality wise both does same operation of calling once observable is completed but difference is which version of rxjs you are using
Before v5.5 it is been called as finally
From v5.5 it is renamed to finalize(due to keyword restriction), because of the introduction to pipeable Operators which helps better tree shaking. For more info please check this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With