Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow observable.subscribe(var) when Owner available #213

Closed
fdietze opened this issue Jul 3, 2022 · 3 comments
Closed

Allow observable.subscribe(var) when Owner available #213

fdietze opened this issue Jul 3, 2022 · 3 comments

Comments

@fdietze
Copy link
Collaborator

fdietze commented Jul 3, 2022

I'd like to sync Observable into RxWriter/Observers:

// with implicit Owner in scope:
val number = Var(0)
Observable.intervalMillis(1000).subscribe(number)
@cornerman
Copy link
Owner

Just to understand better: You mean, that subscribe on observables should take an implicit owner? I would not like to do that, I think the owner concept is good for the hot variables use-case, but not generally for observables.

You can easily just convert the observable to an Rx and work from there:

Rx.observableSync(Observable.intervalMillis(1000)).subscribe(number)

@fdietze
Copy link
Collaborator Author

fdietze commented Jul 4, 2022

Insight from our offline discussion:

Not every Observable can be converted to Rx, because the observable might never trigger. And using a seed can be wrong, because you might not want the subscription to write anything into the target when the observable never triggers.

@cornerman
Copy link
Owner

closed via #271

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

No branches or pull requests

2 participants