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 e9c4033
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 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() {}
}

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() {
becomeActive(EmptyLoadRequest())
}

mutating func finish(
mutating public func finish(
_ result: Result<Value, Error>
) {
finish(EmptyLoadRequest(), result: result)
Expand Down
2 changes: 0 additions & 2 deletions Sources/ComposableLoadable/Loadable/LoadingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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.
}
}
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 e9c4033

Please sign in to comment.