mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Demo apps: document why we use .immediate observation scheduling
This commit is contained in:
1 parent
5d69d2a35b
commit
0d8d40d683
3 files changed
+8
-2
No files matched your search
@@ -33,7 +33,9 @@ struct PlayerRequest: Queryable {
|
||||
.trackingConstantRegion(fetchValue(_:))
|
||||
.publisher(
|
||||
in: appDatabase.databaseReader,
|
||||
scheduling: .immediate) // Feed the view without delay
|
||||
// Immediate scheduling feeds the view right on subscription,
|
||||
// and avoids an undesired animation when the application starts.
|
||||
scheduling: .immediate)
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,9 @@ struct PlayerRequest: Queryable {
|
||||
.trackingConstantRegion(fetchValue(_:))
|
||||
.publisher(
|
||||
in: appDatabase.databaseReader,
|
||||
scheduling: .immediate) // Feed the view without delay
|
||||
// Immediate scheduling feeds the view right on subscription,
|
||||
// and avoids an undesired animation when the application starts.
|
||||
scheduling: .immediate)
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -110,6 +110,8 @@ class PlayerListViewController: UITableViewController {
|
||||
.tracking(request.fetchAll(_:))
|
||||
.start(
|
||||
in: AppDatabase.shared.databaseReader,
|
||||
// Immediate scheduling feeds the data source right on subscription,
|
||||
// and avoids an undesired animation when the application starts.
|
||||
scheduling: .immediate,
|
||||
onError: { error in fatalError("Unexpected error: \(error)") },
|
||||
onChange: { [weak self] players in
|
||||
|
||||
Reference in new issue
Block a user