Skip to content

Commit

Permalink
Merge PromiseOptions and SubscribeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino committed Jan 4, 2024
1 parent 6843362 commit 75d46a9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,6 @@ dictionary SubscribeOptions {
AbortSignal signal;
};

dictionary PromiseOptions {
AbortSignal signal;
};

callback Predicate = boolean (any value);
callback Reducer = any (any accumulator, any currentValue);
callback Mapper = any (any element, unsigned long long index);
Expand Down Expand Up @@ -355,13 +351,13 @@ interface Observable {
Observable flatMap(Mapper mapper);

// Promise-returning operators.
Promise<sequence<any>> toArray(optional PromiseOptions options = {});
Promise<undefined> forEach(Visitor callback, optional PromiseOptions options = {});
Promise<boolean> every(Predicate predicate, optional PromiseOptions options = {});
// Maybe? Promise<any> first(optional PromiseOptions options = {});
Promise<any> find(Predicate predicate, optional PromiseOptions options = {});
Promise<boolean> some(Predicate predicate, optional PromiseOptions options = {});
Promise<any> reduce(Reducer reducer, optional any initialValue, optional PromiseOptions options = {});
Promise<sequence<any>> toArray(optional SubscribeOptions options = {});
Promise<undefined> forEach(Visitor callback, optional SubscribeOptions options = {});
Promise<boolean> every(Predicate predicate, optional SubscribeOptions options = {});
// Maybe? Promise<any> first(optional SubscribeOptions options = {});
Promise<any> find(Predicate predicate, optional SubscribeOptions options = {});
Promise<boolean> some(Predicate predicate, optional SubscribeOptions options = {});
Promise<any> reduce(Reducer reducer, optional any initialValue, optional SubscribeOptions options = {});
};
</xmp>

Expand Down Expand Up @@ -620,7 +616,7 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
:: <span class=XXX>TODO: [=Resolve=] |p| with |values|.</span>

1. <span class=XXX>TODO: Finish the actual spec for this method and use |options|'s
{{PromiseOptions/signal}} to [=reject=] |p| appropriately.</span>
{{SubscribeOptions/signal}} to [=reject=] |p| appropriately.</span>

1. <a for=Observable lt="subscribe to an Observable">Subscribe</a> to [=this=] given |observer|
and |options|.
Expand Down

0 comments on commit 75d46a9

Please sign in to comment.