Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Rx Observable from an object #704

Closed
xgrommx opened this issue May 13, 2015 · 7 comments
Closed

Rx Observable from an object #704

xgrommx opened this issue May 13, 2015 · 7 comments

Comments

@xgrommx
Copy link
Contributor

xgrommx commented May 13, 2015

Hello everyone. Anyone have experience use Rx with objects? Like so:

Rx.Observble.from({a: 1, b: 2}).subscribe(console.log.bind(console));

Also I need something like that https://github.com/baconjs/bacon.js#bacon-combinetemplate. But In Rx this operator doesn't exists.

@paulpdaniels
Copy link
Contributor

To the first part of your question use Observable.pairs() instead of from() for objects (note the documentation page is currently missing from the main docs, so you'll have to go here.

To the second, will combineLatest() or withLatestFrom() not work? They appear to be about the same minus some syntactic sugar.

@mattpodwysocki
Copy link
Member

@xgrommx yeah, pairs is the right operator to use as from requires an array-like object with a length property. I will update the docs to include pairs.

@mattpodwysocki
Copy link
Member

@paulpdaniels where is pairs missing from our documents?

@paulpdaniels
Copy link
Contributor

Whoa, apparently I need more sleep, I was staring right at them. False alarm I guess.

@xgrommx
Copy link
Contributor Author

xgrommx commented May 13, 2015

Thanks! @mattpodwysocki What about Bacon.combineTemplate? Rx has alternative for it? Also I create some interesting example for Rx.Observable.partition http://xgrommx.github.io/rx-book/content/core_objects/observable/observable_instance_methods/partition.html. Also @mattpodwysocki could you please look on this pull request Reactive-Extensions/rx.angular.js#78 (Sorry offtopic)

@xgrommx
Copy link
Contributor Author

xgrommx commented May 14, 2015

I found it https://github.com/ahomu/rx.observable.combinetemplate. This is awesome =)

@paulpdaniels
Copy link
Contributor

So....closed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants