Skip to content

Commit

Permalink
Simplify take() internal observer
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino committed Feb 13, 2024
1 parent 41a011f commit 5f16fc8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,6 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
1. If |amount| is 0, then run |subscriber|'s {{Subscriber/complete()}} method and abort
these steps.

1. Let |controller| be a [=new=] {{AbortController}}.

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

: [=internal observer/next steps=]
Expand All @@ -728,11 +726,7 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w

1. Decrement |amount|.

1. If |amount| is 0, then:

1. Run |subscriber|'s {{Subscriber/complete()}} method.

1. [=AbortController/Signal abort=] |controller|.
1. If |amount| is 0, then run |subscriber|'s {{Subscriber/complete()}} method.

: [=internal observer/error steps=]
:: Run |subscriber|'s {{Subscriber/error()}} method, given the passed in <var
Expand All @@ -741,11 +735,8 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
: [=internal observer/complete steps=]
:: Run |subscriber|'s {{Subscriber/complete()}} method.

1. Let |signal| be the result of [=creating a dependent abort signal=] from the list
«|controller|'s [=AbortController/signal=], |subscriber|'s [=Subscriber/signal=]», using
{{AbortSignal}}, and the [=current realm=].

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

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

0 comments on commit 5f16fc8

Please sign in to comment.