Purpose of finally #6191
mr1upmachine
started this conversation in
General
Replies: 1 comment 1 reply
-
The 2 code snippets that you shared are not equivalent, because the callback passed to NEVER.pipe(
tap({
error: () => {
console.log("tap got called!")
},
complete: () => {
console.log("tap got called!")
},
}),
finalize(() => {
console.log("finalize got called!")
}),
).subscribe().unsubscribe() logs "finalize got called!" and it doesn't log "tap got called!". |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the purpose of the
finally
operator function? These two code blocks seem identical to me:What purpose is
finally
serving other than being a more concise version oftap
, if any? If that is all it is doing, then maybe we can add something to the documentation to reflect that? Or consider removingfinally
to make the API more concise? Or perhaps my personal understanding is lacking 😆Beta Was this translation helpful? Give feedback.
All reactions