Skip to content

Commit

Permalink
chore: public accessor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danthorpe committed Sep 17, 2024
1 parent d21a0f5 commit bf15d6e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Sources/ComposableLoadable/Loadable/LoadableClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ package protocol LoadableClient<Request, State, Value> {
var load: @Sendable (Request, State) async throws -> Value { get }
}

public struct EmptyLoadRequest: Equatable {}
public struct EmptyLoadRequest: Equatable {
public init() {}

Check warning on line 14 in Sources/ComposableLoadable/Loadable/LoadableClient.swift

View check run for this annotation

Codecov / codecov/patch

Sources/ComposableLoadable/Loadable/LoadableClient.swift#L14

Added line #L14 was not covered by tests
}

struct LoadingClient<Request, State, Value>: LoadableClient {
var load: @Sendable (Request, State) async throws -> Value
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableLoadable/Loadable/LoadableState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ extension LoadableState where Request == EmptyLoadRequest {
self.init(request: EmptyLoadRequest(), failure: error)
}

mutating func becomeActive() {
mutating public func becomeActive() {

Check warning on line 242 in Sources/ComposableLoadable/Loadable/LoadableState.swift

View check run for this annotation

Codecov / codecov/patch

Sources/ComposableLoadable/Loadable/LoadableState.swift#L242

Added line #L242 was not covered by tests
becomeActive(EmptyLoadRequest())
}

mutating func finish(
mutating public func finish(
_ result: Result<Value, Error>
) {
finish(EmptyLoadRequest(), result: result)
Expand Down
4 changes: 3 additions & 1 deletion Sources/ComposableLoadable/Loadable/LoadingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ extension LoadingAction where Request == EmptyLoadRequest {

// MARK: - Conformances

extension LoadingAction: Equatable where Value: Equatable {}
extension LoadingAction: Equatable where Value: Equatable {
// NOTE: Define conformance here, but implementation is below
}

extension LoadingAction where Request: Equatable, Value: Equatable, Action: Equatable {
public static func == (lhs: Self, rhs: Self) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Check warning on line 54 in Sources/ComposableLoadable/Pagination/PaginationFeature+.swift

View check run for this annotation

Codecov / codecov/patch

Sources/ComposableLoadable/Pagination/PaginationFeature+.swift#L53-L54

Added lines #L53 - L54 were not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
Expand Down

0 comments on commit bf15d6e

Please sign in to comment.