Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec the toArray() operator #97

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -605,25 +605,31 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
<div algorithm>
The <dfn for=Observable method><code>toArray(|options|)</code></dfn> method steps are:

1. If [=this=]'s [=relevant global object=] is a {{Window}} object, and its [=associated
Document=] is not [=Document/fully active=], then return.
domfarolino marked this conversation as resolved.
Show resolved Hide resolved

1. Let |p| [=a new promise=].

1. If |options|'s {{SubscribeOptions/signal}} is [=AbortSignal/aborted=], then:
1. If |options|'s {{SubscribeOptions/signal}} is not null:

1. If |options|'s {{SubscribeOptions/signal}} is [=AbortSignal/aborted=], then:

1. [=Reject=] |p| with |options|'s {{SubscribeOptions/signal}}'s [=AbortSignal/abort
reason=].
1. [=Reject=] |p| with |options|'s {{SubscribeOptions/signal}}'s [=AbortSignal/abort
reason=].

1. Return |p|.
1. Return |p|.

1. [=AbortSignal/add|Add the following abort algorithm=] to |options|'s
{{SubscribeOptions/signal}}:
1. [=AbortSignal/add|Add the following abort algorithm=] to |options|'s
{{SubscribeOptions/signal}}:

1. [=Reject=] |p| with |options|'s {{SubscribeOptions/signal}}'s [=AbortSignal/abort
reason=].
1. [=Reject=] |p| with |options|'s {{SubscribeOptions/signal}}'s [=AbortSignal/abort
reason=].

Note: All we have to do here is [=reject=] |p|. Note that the subscription to [=this=]
{{Observable}} will also be canceled automatically, since the "inner" [=Subscriber/signal=]
(created during <a for=Observable lt="subscribe to an Observable">subscription</a>) is a
[=AbortSignal/dependent signal=] of |options|'s {{SubscribeOptions/signal}}.
Note: All we have to do here is [=reject=] |p|. Note that the subscription to [=this=]
{{Observable}} will also be canceled automatically, since the "inner"
[=Subscriber/signal=] (created during <a for=Observable lt="subscribe to an
Observable">subscription</a>) is a [=AbortSignal/dependent signal=] of |options|'s
{{SubscribeOptions/signal}}.

1. Let |values| be a new [=list=].

Expand Down