https://kotlinlang.org logo
#rx
Title
# rx
g

gvoltr

03/12/2017, 2:36 PM
Hello guys, can please someone explain me why using rxJava2 I have next situation: Using java Observable.fromArray(new String[]{"one", "two", “three”}) emit strings one by one Using kotlin Observable.fromArray(arrayOf("one", "two", “three”)) emit one element - array of strings
m

mg6maciej

03/12/2017, 9:26 PM
You should avoid using
arrayOf
and
new String[] {}
in both cases.
fromArray
takes varargs, so just call it directly with
Observable.fromArray("one", "two", "three")
in both languages.
7 Views