Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SQLiteData/Fetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension Fetch: Equatable where Value: Equatable {
public func load(
_ request: some FetchKeyRequest<Value>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription {
try await sharedReader.load(.fetch(request, database: database, animation: animation))
return FetchSubscription(sharedReader: sharedReader)
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLiteData/FetchAll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ extension FetchAll: Equatable where Element: Equatable {
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Element == S.From.QueryOutput,
Expand All @@ -557,7 +557,7 @@ extension FetchAll: Equatable where Element: Equatable {
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Element == V.QueryOutput,
Expand Down
12 changes: 6 additions & 6 deletions Sources/SQLiteData/FetchOne.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value == S.From.QueryOutput,
Expand All @@ -1213,7 +1213,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value == V.QueryOutput
Expand All @@ -1235,7 +1235,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value == V.QueryOutput?
Expand All @@ -1257,7 +1257,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value: StructuredQueriesCore._OptionalProtocol,
Expand All @@ -1282,7 +1282,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load<S: StructuredQueriesCore.Statement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value: StructuredQueriesCore._OptionalProtocol,
Expand All @@ -1307,7 +1307,7 @@ extension FetchOne: Equatable where Value: Equatable {
public func load(
_ statement: some StructuredQueriesCore.Statement<Value>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) async throws -> FetchSubscription
where
Value: QueryRepresentable,
Expand Down
8 changes: 4 additions & 4 deletions Sources/SQLiteData/Internal/FetchKey+SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
static func fetch<Value>(
_ request: some FetchKeyRequest<Value>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) -> Self
where Self == FetchKey<Value> {
.fetch(request, database: database, scheduler: .animation(animation))
Expand All @@ -16,15 +16,15 @@
static func fetch<Records: RangeReplaceableCollection>(
_ request: some FetchKeyRequest<Records>,
database: (any DatabaseReader)? = nil,
animation: Animation
animation: Animation?
) -> Self
where Self == FetchKey<Records>.Default {
.fetch(request, database: database, scheduler: .animation(animation))
}
}

package struct AnimatedScheduler: ValueObservationScheduler, Equatable {
let animation: Animation
let animation: Animation?
package func immediateInitialValue() -> Bool { true }
package func schedule(_ action: @escaping @Sendable () -> Void) {
DispatchQueue.main.async {
Expand All @@ -39,7 +39,7 @@
extension AnimatedScheduler: Hashable {}

extension ValueObservationScheduler where Self == AnimatedScheduler {
package static func animation(_ animation: Animation) -> Self {
package static func animation(_ animation: Animation?) -> Self {
AnimatedScheduler(animation: animation)
}
}
Expand Down