Skip to content

Commit b8ee44b

Browse files
authored
Make take()/drop() not share state across calls (#155)
1 parent 7b4cb07 commit b8ee44b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spec.bs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,9 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
770770

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

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

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

783-
1. Decrement |amount|.
784+
1. Decrement |remaining|.
784785

785-
1. If |amount| is 0, then run |subscriber|'s {{Subscriber/complete()}} method.
786+
1. If |remaining| is 0, then run |subscriber|'s {{Subscriber/complete()}} method.
786787

787788
: [=internal observer/error steps=]
788789
:: Run |subscriber|'s {{Subscriber/error()}} method, given the passed in <var
@@ -811,13 +812,14 @@ For now, see [https://github.com/wicg/observable#operators](https://github.com/w
811812

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

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

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

820-
1. [=Assert=]: |amount| is 0.
822+
1. [=Assert=]: |remaining| is 0.
821823

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

0 commit comments

Comments
 (0)