- Why would you use Observables/FRP if you are just using toBlocking().single()
- RxJava is built around the idea of functional programming, which tries to push ‘pure’ functions and immutable data. Your ‘transform’ function is very bad practice how it changes and returns the same object, it should return a new object with a different value
- Why did you create the ‘Object’ class? You could have just used Boolean? (Since you are only concerned with true/false).
- The chain is performed twice every time you flick the switch just because you want to log the output. You should store the result in a variable maybe?
- You repeat code everywhere (I know this is a sample but it’s like against every programmers nature to repeat the stuff you have)
Of course the example needs to be simple and easy to understand, but you just don’t seem have a clue about the benefits of functional reactive programming.