Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Have stores emit only non-null values #148
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:
or with the help of a wrapper, such as an optional:
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.