Documentation

This commit is contained in:
Gwendal Roué committed 2021-03-23 18:33:02 +01:00
1 parent 21b22ab3fb
commit c5aeec3385
1 file changed
+3 -3
+3 -3
View File
@@ -275,7 +275,7 @@ let observation = ValueObservation.tracking { db in
try Place.fetchAll(db)
}
// Start observation (Vanilla GRDB)
// Start observation
let cancellable = observation.start(
in: dbQueue,
onError: { error in ... }
@@ -285,12 +285,12 @@ let cancellable = observation.start(
Ready-made support for Combine and RxSwift:
```swift
// Start observation (Combine)
// Combine
let cancellable = observation.publisher(in: dbQueue).sink(
receiveCompletion: { completion in ... },
receiveValue: { (places: [Place]) in print("Fresh places: \(places)") })
// Start observation (RxSwift)
// RxSwift
let disposable = observation.rx.observe(in: dbQueue).subscribe(
onNext: { (places: [Place]) in print("Fresh places: \(places)") },
onError: { error in ... })