Skip to content

Commit

Permalink
Make take()/drop() not share state across calls (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamesernator authored Jul 11, 2024
1 parent 7b4cb07 commit b8ee44b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,9 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w

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

1. If |amount| is 0, then run |subscriber|'s {{Subscriber/complete()}} method and abort
1. If |remaining| is 0, then run |subscriber|'s {{Subscriber/complete()}} method and abort
these steps.

1. Let |sourceObserver| be a new [=internal observer=], initialized as follows:
Expand All @@ -780,9 +781,9 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
:: 1. Run |subscriber|'s {{Subscriber/next()}} method with the passed in <var
ignore>value</var>.

1. Decrement |amount|.
1. Decrement |remaining|.

1. If |amount| is 0, then run |subscriber|'s {{Subscriber/complete()}} method.
1. If |remaining| 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 Down Expand Up @@ -811,13 +812,14 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w

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

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

: [=internal observer/next steps=]
:: 1. If |amount| is &gt; 0, then decrement |amount| and abort these steps.
:: 1. If |remaining| is &gt; 0, then decrement |remaining| and abort these steps.

1. [=Assert=]: |amount| is 0.
1. [=Assert=]: |remaining| is 0.

1. Run |subscriber|'s {{Subscriber/next()}} method with the passed in <var
ignore>value</var>.
Expand Down

0 comments on commit b8ee44b

Please sign in to comment.