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

MVICore RxJava3 update #198

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

kamikatze2008
Copy link

@kamikatze2008 kamikatze2008 commented Sep 13, 2024

Description

...

Check list

  • I have updated CHANGELOG.md if required.
  • I have updated documentation if required.

)
}
}
val event = cachedEvents[firstKey]

Choose a reason for hiding this comment

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

Are you sure this always works?

Copy link
Collaborator

@CherryPerry CherryPerry Sep 15, 2024

Choose a reason for hiding this comment

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

Well, it is a good question. But it is true for the previous implementation too.

.let { key ->
  Observable.fromIterable(cachedEvents[key])
  ...
}

RxJava2 version does not have @NonNull annotation, so Kotlin compiler allows passing a nullable value here, while it will still throw an exception in runtime.

RxJava3 version now has @NonNull annotation, so Kotlin compiler is more strict here.

Copy link
Author

Choose a reason for hiding this comment

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

I doubt it worked fine in the previous version as well. Because the result of the subscription is not used anywhere, hence there’s no manual unsubscribe implemented.

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.

4 participants