Skip to content

Commit

Permalink
Spec the finally() operator (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino authored Feb 21, 2025
1 parent a091c5a commit 45a6cec
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,33 @@ For now, see
<div algorithm>
The <dfn for=Observable method><code>finally(|callback|)</code></dfn> method steps are:

1. <span class=XXX>TODO: Spec this and use |callback|.</span>
1. Let |sourceObservable| be [=this=].

1. Let |observable| be a [=new=] {{Observable}} whose [=Observable/subscribe callback=] is an
algorithm that takes a {{Subscriber}} |subscriber| and does the following:

1. Run |subscriber|'s {{Subscriber/addTeardown()}} method with |callback|.

1. Let |sourceObserver| be a new [=internal observer=], initialized as follows:

: [=internal observer/next steps=]
:: Run |subscriber|'s {{Subscriber/next()}} method, given the passed in <var
ignore>value</var>.

: [=internal observer/error steps=]
:: 1. Run |subscriber|'s {{Subscriber/error()}} method, given the passed in <var
ignore>error</var>.

: [=internal observer/complete steps=]
:: 1. Run |subscriber|'s {{Subscriber/complete()}} method.

1. Let |options| be a new {{SubscribeOptions}} whose {{SubscribeOptions/signal}} is
|subscriber|'s [=Subscriber/subscription controller=]'s [=AbortController/signal=].

1. <a for=Observable lt="subscribe to an Observable">Subscribe</a> to |sourceObservable|
given |sourceObserver| and |options|.

1. Return |observable|.
</div>


Expand Down

0 comments on commit 45a6cec

Please sign in to comment.