ReactiveCrudRepository to use Hibernate in spring

Is it possible to use Hibernate and Mysql with ReactiveCrudRepository instead of CrudRepository? TL;DR: Not with Hibernate and MySQL, but with R2DBC and Postgres, Microsoft SQL Server or H2. Take a look at Spring Data R2DBC. Long Version Why not JPA? With Hibernate/JPA included this won’t happen in the foreseeable future. JPA is based on … Read more

Vue change object in array and trigger reactivity

You could update the sub-property in the array element with this.$set(). For example, to increment an x subproperty in the first two array elements (creating the sub-property if it doesn’t exist): methods: { update() { this.$set(this.arr[0].foo, ‘x’, (this.arr[0].foo.x || 0) + 100) this.$set(this.arr[1].foo, ‘x’, (this.arr[1].foo.x || 0) + 100) } } new Vue({ el: ‘#app’, … Read more

Websockets vs Reactive sockets

What is RSocket? RSocket implements the Reactive Streams specification over the network boundary. It is an application-level communication protocol with framing, session resumption, and backpressure built-in that works over the network. RSocket is transport agnostic. RSocket can be run over Websockets, TCP, HTTP/2, and Aeron. How does RSocket differ from Websockets? Websockets do not provide … Read more

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