effective-rxjava icon indicating copy to clipboard operation
effective-rxjava copied to clipboard

fromCallable in "Convert functions to Observable"

Open sebaslogen opened this issue 9 years ago • 1 comments

Reading the defer+just solution I remembered there is a fromCallable() in Rx, wouldn't solve the problem described in a simpler way?

http://reactivex.io/documentation/operators/start.html

http://artemzin.com/blog/rxjava-defer-execution-of-function-via-fromcallable/

Is there any advantage in using defer+just instead of fromCallable in your example?

sebaslogen avatar Mar 13 '16 12:03 sebaslogen

Huh, interesting! I think when we were developing the Khan Academy Android app, fromCallable wasn't yet implemented? (We also had a slight aversion to using any function that was annotated @Experimental.)

I will investigate to see if there are any differences, and update the item to specify fromCallable if there are not! Thank you for reporting this!

mgp avatar Mar 16 '16 07:03 mgp