chore(observavles): Added ObservableMeteorSubscription and Observable…#362
Conversation
…Cursor with additional methods
|
@hongbo-miao I updated the example repo with an example for ubsubscribe from Meteor's subscription. |
|
Yeah, I am trying it! That is a smart way to handle unsubscribe |
|
@dotansimha Think if we have 100 products, then it will run 100 times. Need improve it to make it disptach And when unsubscribe, it dispatch double times, which is 6 times. |
|
@hongbo-miao @Urigo |
|
Actually, I think that it is better to use lodash's |
|
@dotansimha Oh, maybe we can use |
|
Yeah that's sound good, but I think that it requires more that basic knowledge of RxJS... and I think that this is a problem that we need to solve in angular2-meteor, and provide a good solution for the users. |
|
@dotansimha I feel in this case, |
|
It crossed my mind, but I think that we need to prevent the call of |
|
@dotansimha DDP The second we may catch the |
|
The DDP message you are looking at are the subscription ready, which has nothing to do with the Collection events... the subscription events brings a chunk of objects and declare the "ready" event of the Meteor subscription, then the actual DDP message splitted into separate messages (one for each object), and then inserted into the Mongo Collection, then it call |
|
Oh sorry, you mean Collection's |
|
Related: #363 |
|
Hey, Dotan @dotansimha. I am making use of observables in MeteorComponent now, as a part of next version 0.7.0v. So I looked a bit closely into them, and have question. As I understand Also there seems to be an issue with the Mongo cursor's callbacks (see #358 (comment)). I think we'll need to change |


…Cursor with additional methods
@hongbo-miao @Urigo @kamilkisiela @barbatus
Changes made:
ObservableMeteorSubscriptionas return value forMeteorObservable.subscribewith API for stopping the subscription manually (.stop()).Example:
ObservableCursoras return value for.find({})with API for creating non-reactiveObservableby using.nonReactive()and API for reloading non-reactive manually by using.reload().Example:
Both
ObservableMeteorSubscriptionandObservableCursorinherits from RxJSObservableso you can use it without any changes in your code.