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

Prepare for 0.2.0 #68

Closed
ZacSweers opened this issue May 7, 2017 · 4 comments
Closed

Prepare for 0.2.0 #68

ZacSweers opened this issue May 7, 2017 · 4 comments
Assignees
Milestone

Comments

@ZacSweers
Copy link
Collaborator

ZacSweers commented May 7, 2017

This adds autoDisposeWith() extensions to RxJava types.

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

Modeled after RxJava's plugins, this allows you to customize the behavior of AutoDispose with lifecycle boundary checks.

AutoDisposePlugins.setOutsideLifecycleHandler(t -> {
    // Swallow the exception, or rethrow it, or throw your own!
})

A good use case of this is, say, just silently disposing/logging observers outside of lifecycle exceptions in production but crashing on debug.

Two helpers were added to simulate conditions in testing.

  • TestLifecycleScopeProvider
    • This has two corresponding lifecycle methods: start() and stop()
  • TestScopeProvider
    • Has just one method - emit().

For testing with just the Maybe<?> scope, we recommend using RxJava's built-in MaybeSubject.

Other tidbits:

  • Removed @NonNull annotations. Everything is @NonNull by default, and only elements
    annotated with @Nullable are not.
  • Use of the new java-library plugin for gradle (Update to java-library plugin #64). The RxJava dependencies are marked as api.
  • Error prone has been integrated. Currently the annotations are just marked as compileOnly, but if a need arises/community wants them - we can compile them in a future version.
@ZacSweers ZacSweers added this to the 0.2.0 milestone May 7, 2017
@ZacSweers ZacSweers self-assigned this May 7, 2017
@ZacSweers
Copy link
Collaborator Author

ZacSweers commented May 7, 2017

@tonycosentini @LukeStClair @uber/mobile-platform-android if this all looks good, we can cut a release monday or tuesday

@AttwellBrian
Copy link

New: Plugin system! (#57)

Nice idea. Why do we need setOutsideLifecycleHandler when we already have the ability to RxPlugins to suppress this errors with RxPlugins?

@tonycosentini
Copy link
Contributor

tonycosentini commented May 8, 2017 via email

@ZacSweers
Copy link
Collaborator Author

Released!

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

3 participants