diff --git a/Sources/ComposableLoadable/Loadable/LoadableClient.swift b/Sources/ComposableLoadable/Loadable/LoadableClient.swift index f58abb852..30abbd6f8 100644 --- a/Sources/ComposableLoadable/Loadable/LoadableClient.swift +++ b/Sources/ComposableLoadable/Loadable/LoadableClient.swift @@ -10,7 +10,9 @@ package protocol LoadableClient { var load: @Sendable (Request, State) async throws -> Value { get } } -public struct EmptyLoadRequest: Equatable {} +public struct EmptyLoadRequest: Equatable { + public init() {} +} struct LoadingClient: LoadableClient { var load: @Sendable (Request, State) async throws -> Value diff --git a/Sources/ComposableLoadable/Loadable/LoadableState.swift b/Sources/ComposableLoadable/Loadable/LoadableState.swift index d0f7590fb..c8f9cb337 100644 --- a/Sources/ComposableLoadable/Loadable/LoadableState.swift +++ b/Sources/ComposableLoadable/Loadable/LoadableState.swift @@ -239,11 +239,11 @@ extension LoadableState where Request == EmptyLoadRequest { self.init(request: EmptyLoadRequest(), failure: error) } - mutating func becomeActive() { + mutating public func becomeActive() { becomeActive(EmptyLoadRequest()) } - mutating func finish( + mutating public func finish( _ result: Result ) { finish(EmptyLoadRequest(), result: result) diff --git a/Sources/ComposableLoadable/Loadable/LoadingAction.swift b/Sources/ComposableLoadable/Loadable/LoadingAction.swift index fcbcaf375..721598b38 100644 --- a/Sources/ComposableLoadable/Loadable/LoadingAction.swift +++ b/Sources/ComposableLoadable/Loadable/LoadingAction.swift @@ -22,8 +22,6 @@ extension LoadingAction where Request == EmptyLoadRequest { // MARK: - Conformances -extension LoadingAction: Equatable where Value: Equatable {} - extension LoadingAction where Request: Equatable, Value: Equatable, Action: Equatable { public static func == (lhs: Self, rhs: Self) -> Bool { switch (lhs, rhs) { diff --git a/Sources/ComposableLoadable/Pagination/PaginationFeature+.swift b/Sources/ComposableLoadable/Pagination/PaginationFeature+.swift index a7e4b5958..c1fbdf877 100644 --- a/Sources/ComposableLoadable/Pagination/PaginationFeature+.swift +++ b/Sources/ComposableLoadable/Pagination/PaginationFeature+.swift @@ -48,3 +48,9 @@ extension PaginationFeature.Action: Equatable where Element: Equatable { } } } + +extension PaginationFeature: Equatable where Element: Equatable { + public static func == (lhs: Self, rhs: Self) -> Bool { + true // There is only behaviour in the reducer itself. + } +} diff --git a/Sources/ComposableLoadable/Pagination/PaginationFeature.swift b/Sources/ComposableLoadable/Pagination/PaginationFeature.swift index 23689658e..59f651c7b 100644 --- a/Sources/ComposableLoadable/Pagination/PaginationFeature.swift +++ b/Sources/ComposableLoadable/Pagination/PaginationFeature.swift @@ -179,7 +179,6 @@ import Foundation public typealias Page = State.Page public typealias PageRequest = State.PageRequest - public typealias LoadPage = @Sendable (PageRequest) async throws -> Page public var body: some ReducerOf {