From 6a25bcad175bb711beaca2687c2794f2a3120932 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Wed, 29 Nov 2023 13:26:03 -0600 Subject: [PATCH] Add more detail about finally --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af20c51..f6d4942 100644 --- a/README.md +++ b/README.md @@ -508,9 +508,10 @@ We propose the following operators in addition to the `Observable` interface: - `finally()` - Like `Promise.finally()`, it takes a callback which gets fired after the observable completes in any way (`complete()`/`error()`). - - Returns an `Observable`, because observable is lazy, finalization - is setup ahead of subscription. This allows for specific finalization to - happen after each step in a reactive chain. + - Returns an `Observable` that mirrors the source observable exactly. The callback + passed to `finally` is fired when a subscription to the resulting observable is terminated + for _any reason_. Either immediately after the source completes or errors, or when the consumer + unsubscribes by aborting the subscription. Versions of the above are often present in userland implementations of observables as they are useful for observable-specific reasons, but in addition