Use ValueObservation.tracking(value:) in demo app

This commit is contained in:
Gwendal Roué committed 2019-08-06 06:54:39 +02:00
1 parent c734eba245
commit eea8f7b1e9
1 file changed
+4 -1
@@ -71,7 +71,10 @@ class PlayersViewController: UITableViewController {
private func configureTitle() {
// Track changes in the number of players
playerCountObserver = playersRequest.observationForCount().start(
let observation = ValueObservation.tracking { db in
try Player.fetchCount(db)
}
playerCountObserver = observation.start(
in: dbQueue,
onError: { error in
fatalError("Unexpected error: \(error)")