Skip to content

Commit

Permalink
Account for observables that only emit null values
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Apr 10, 2024
1 parent faf17e7 commit 063e326
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,16 +1124,20 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w

1. Let |lastValue| be an {{any}}-or-null, initially null.

1. Let |hasLastValue| be a [=boolean=], initially false.

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

: [=internal observer/next steps=]
:: Set |lastValue| to the passed in <var ignore>value</var>.
:: 1. Set |hasLastValue| to true.

1. Set |lastValue| to the passed in <var ignore>value</var>.

: [=internal observer/error steps=]
:: [=Reject=] |p| with the passed in <var ignore>error</var>.

: [=internal observer/complete steps=]
:: 1. If |lastValue| is not null, [=resolve=] |p| with |lastValue|.
:: 1. If |hasLastValue| is true, [=resolve=] |p| with |lastValue|.

1. Otherwise, [=reject=] |p| with a [=new=] {{RangeError}}.

Expand Down

0 comments on commit 063e326

Please sign in to comment.