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 kotlin module #47

Merged
merged 7 commits into from
Mar 14, 2017
Merged

Add kotlin module #47

merged 7 commits into from
Mar 14, 2017

Conversation

ZacSweers
Copy link
Collaborator

Resolves #7

This tacks on convenience extension functions to RxJava types, such that you can just do this:

myObservable
    .doWhatever()
    .autoDisposeWith(this)
    .subscribe()

Did some opportunistic project house cleaning as well

@ZacSweers
Copy link
Collaborator Author

@0legg would be super curious to get your thoughts on this.

@0legg
Copy link
Contributor

0legg commented Mar 14, 2017

LGTM, the only thing I have add to it — have you tried Spek for unit tests?

.autoDisposeWith(scopeMaybe)
.subscribe(o)

o.assertValue { v -> v == "Hello" }
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use it for brevity; while it's better to have named lambda parameters for more complicated logic, oneliner will look nicer with it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point - 2e047aa

Forgot this makes when blocks with instance checks really pretty.

return Function {
  when (it) {
    is Start -> End()
    is End -> throw LifecycleEndedException()
  }
}

@ZacSweers
Copy link
Collaborator Author

ZacSweers commented Mar 14, 2017

screen shot 2017-03-12 at 1 45 57 am

Heh, so I actually tried spek with this, but every time I try spek something seems to go stupidly wrong. It seems super unreliable, either with its build setup or just plain not working (exception thrown above is considered successful ¯\_(ツ)_/¯). I get a totally different error when trying to run from the command line too

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2017

CLA assistant check
All committers have signed the CLA.

@ZacSweers ZacSweers merged commit 238c82a into master Mar 14, 2017
@ZacSweers ZacSweers deleted the kotlin branch March 14, 2017 19:51
@0legg
Copy link
Contributor

0legg commented Mar 14, 2017

@hzsweers There are some notes on enabling Spek with JUnit 4, and it looks like IDE isn't supported at this time — CLI only.

@ZacSweers ZacSweers mentioned this pull request May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants