Difference between @Controller and RouterFunction in Spring 5 WebFlux

Programming Paradigm: Imperative vs Functional In the case with the @Controller or @RestController annotations, we agree with the annotation-based model where we use annotations for mappings (and not only) and as a result side effects (that is not allowed in the functional world) to make our API works. Such side effects could be @Valid annotation … Read more

How to check if Mono is empty?

The techniques that allow checking whether Flux/Mono is empty Using operators .switchIfEmpty/.defaultIfEmpty/Mono.repeatWhenEmpty Using mentioned operators you will be able to react to the case when Stream has been completed without emitting any elements. First of all, remember that operators such .map, .flatMap, .filter and many others will not be invoked at all if there no … Read more

An equivalent to computed properties using @Published in Swift Combine?

You don’t need to do anything for computed properties that are based on @Published properties. You can just use it like this: class UserManager: ObservableObject { @Published var currentUser: User? var userIsLoggedIn: Bool { currentUser != nil } } What happens in the @Published property wrapper of currentUser is that it will call objectWillChange.send() of … Read more

When to use RxJava in Android and when to use LiveData from Android Architectural Components?

Regarding the original question, both RxJava and LiveData complement each other really well. LiveData shines on ViewModel layer, with its tight integration with Android lifecycles and ViewModel. RxJava provides more capabilities in transformations (as mentioned by @Bob Dalgleish). Currently, we’re using RxJava in data source and repository layers, and it’s transformed into LiveData (using LiveDataReactiveStreams) … Read more