Friday, 15 April 2011

javascript - why does second subscribtion not receive any values when subscribing twice to observable in rx 2.3? -


I do not have this barebones example as I would expect on a expected basis. I hope the membership of both will receive all the values.

The mention of docs:

Two observers then subscribed to this sequence and printed its values. You will see that there is sequence reset for each customer, in which the second subscription will restart the sequence with the first value.

  s1 = Rx.Observable.from ([1, 2, 3, 4, 9, 11]) s1.subscribe (x = & console; log (x) X = & gt; console.log (x), x => Console.log ('full')) s1.subscribe (x => console.log (x), x = & console; log (x ), X = & console; log ('full'))  

However the second subscription simply logs 'full'

As it suggests that the example Works as expected in rxjs 2.4, but not in 2.3. Does anyone know what changed? I can not see it

There is a JSfield with 2.3.20 here:

and here it is with 2.4.1:

< Div class = "post-text" itemprop = "text">

This is not the right behavior for a cold viewable. An object created from an orchestra keeps an eye cooling and can not share more membership with an observer. To do the right thing you can change your sample for a hot observation. You can see this documentation. In your case, you can do something like that now both the members work in parallel.


No comments:

Post a Comment