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

Add lift to rxscala #1124

Merged
merged 4 commits into from
May 5, 2014
Merged

Add lift to rxscala #1124

merged 4 commits into from
May 5, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Apr 28, 2014

This PR added lift to RxScala and also added a Subscriber.apply method to support to chain Subscribers.

/cc @samuelgruetter

@cloudbees-pull-request-builder

RxJava-pull-requests #1036 FAILURE
Looks like there's a problem with this pull request

// Add "No. " in front of each item
val o = List(1, 2, 3).toObservable.lift {
subscriber: Subscriber[String] =>
Subscriber(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if it's not required, I'd write Subscriber[Int] here, so that people immediately see that the function is of type Subscriber[String] => Subscriber[Int]

@cloudbees-pull-request-builder

RxJava-pull-requests #1037 FAILURE
Looks like there's a problem with this pull request

@zsxwing
Copy link
Member Author

zsxwing commented Apr 29, 2014

Thank you for reviewing the codes, @samuelgruetter. I added the Operator conversion, and the tail operator as an exmpale of lift.

Do you have any better idea about liftExample2?

@cloudbees-pull-request-builder

RxJava-pull-requests #1044 SUCCESS
This pull request looks good

@benjchristensen
Copy link
Member

Is this ready?

@@ -54,4 +54,12 @@ object JavaConversions {
val asJavaObservable = observable
}
}

implicit def toJavaOperator[T, R](operator: Subscriber[R] => Subscriber[_ >: T]): rx.Observable.Operator[R, T] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use _ >: T on a contravariant Scala type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Already removed it.

@cloudbees-pull-request-builder

RxJava-pull-requests #1053 SUCCESS
This pull request looks good

@samuelgruetter
Copy link
Contributor

LGTM. Thank you @zsxwing

benjchristensen added a commit that referenced this pull request May 5, 2014
@benjchristensen benjchristensen merged commit 08dfede into ReactiveX:master May 5, 2014
@zsxwing zsxwing deleted the scala-lift branch May 8, 2014 12:42
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

Successfully merging this pull request may close these issues.

None yet

4 participants