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

Have stores emit only non-null values #148

Merged
merged 10 commits into from Dec 19, 2016

Conversation

Projects
None yet
1 participant
@apoi
Collaborator

apoi commented Nov 15, 2016

Going forward, the stores must not emit null values. This is a requirement since RxJava 1.2+ prohibits it, including the upcoming RxJava2.

This refactoring solves the issue by using a non-null template parameter that may or may not be the same as the store data type. This allows the stores to decide if they want to implement the null-safety within the types themselves:

  • StoreInterface<Key, Value, Value>

or with the help of a wrapper, such as an optional:

  • StoreInterface<Key, Value, Option<Value>>

Store get methods will return the non-null version to make sure getOnce* methods can return a value immediately. It's the responsibility of the application to deal with the empty values by e.g. simply filtering them out.

@apoi apoi merged commit 590cdf6 into master Dec 19, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@apoi apoi removed the pending review label Dec 19, 2016

@apoi apoi deleted the feature/nonnull-store-observables branch Dec 19, 2016

bifri pushed a commit to bifri/reark that referenced this pull request Mar 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment