Improve migration guide

This commit is contained in:
Gwendal Roué committed 2020-04-11 12:43:28 +02:00
1 parent da81c8b87c
commit 478ae7bc24
1 file changed
+2 -2
+2 -2
View File
@@ -131,11 +131,11 @@ ValueObservation.tracking(request.fetchAll).rx.observe(in: dbQueue)
Those changes have the vanilla GRDB, [GRDBCombine], and [RxGRDB], behave 100% identically. This greatly helps choosing or switching your prefered database observation technique. In previous versions of GRDB, the three companion libraries used to suffer from subtle runtime differences that were quite uneasy to spot.
Your attention is quite required in this chapter.
The changes can quite impact your application. We'll describe them below, as well as the strategies to restore the previous behavior.
1. ValueObservation used to notify its initial value *immediately* when the observation starts. Now, it notifies fresh values on the main thread, *asynchronously*, by default.
This means that parts of your application that rely on this immediate value to, say, set up their user interface, have to be modified. Otherwise, they may suffer from a brief flash of missing data, during the short amount of time between the beginning of the observation, and the asynchronous delivery of the initial value.
This means that the parts of your application that rely on this immediate value to, say, set up their user interface, have to be modified. Otherwise, they may suffer from a brief flash of missing data, during the short amount of time between the beginning of the observation, and the asynchronous delivery of the initial value.
To be granted with an immediate, synchronous, delivery of the initial value, insert a `scheduling: .immediate` argument in the `start` method: