From d590a062125bd70b1ab9be1b16e27becd4d2d4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 25 Nov 2021 12:39:50 +0100 Subject: [PATCH] Query documentation --- Documentation/DemoApps/Query/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/DemoApps/Query/README.md b/Documentation/DemoApps/Query/README.md index 75ffa2d4d..b194e780f 100644 --- a/Documentation/DemoApps/Query/README.md +++ b/Documentation/DemoApps/Query/README.md @@ -109,7 +109,7 @@ struct AllPlayers: Queryable { func publisher(in dbQueue: DatabaseQueue) -> AnyPublisher<[Player], Error> { ValueObservation - .tracking { db in try Player.fetchAll(db) } + .tracking(Player.fetchAll) // The `.immediate` scheduling feeds the view right on subscription, // and avoids an initial rendering with an empty list: .publisher(in: dbQueue, scheduling: .immediate) @@ -193,7 +193,7 @@ struct AllPlayers: Queryable { func publisher(in dbQueue: DatabaseQueue) -> AnyPublisher, Never> { ValueObservation - .tracking { db in try Player.fetchAll(db) } + .tracking(Player.fetchAll) .publisher(in: dbQueue, scheduling: .immediate) .map { players in .success(players) } .catch { error in Just(.failure(error)) }