Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: public accessor fixes #18

Merged
merged 3 commits into from
Sep 17, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
{
"os": "macos-14",
"swift": "5.9",
"xcode": "15.1"
"xcode": "15.4"
},
{
"os": "macos-14",
"swift": "5.10",
"xcode": "15.3"
"xcode": "15.4"
}
]
}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.9.0"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.15.0"),
],
targets: [
.target(
Expand Down
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 @@
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 @@
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: 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
Loading