Skip to content

Commit

Permalink
chore: Tweak inits (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: danthorpe <[email protected]>
  • Loading branch information
danthorpe and danthorpe authored Apr 22, 2024
1 parent d71a35b commit c54f985
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package.platforms = [
// MARK: - 🧸 Module Names

let ComposableLoadable = "ComposableLoadable"
let Utilities = "Utilities"

let BasePath = "."

Expand Down
6 changes: 5 additions & 1 deletion Sources/ComposableLoadable/LoadableState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public struct LoadableState<Request, Value> {
}
}

public init(request: Request, wrappedValue: Value?) {
public init(wrappedValue: Value?, request: Request) {
self.init(request: request, wrappedValue.map { .success($0) })
}

Expand Down Expand Up @@ -225,6 +225,10 @@ extension LoadableState where Request == EmptyLoadRequest {
.init(current: .active, previous: .pending)
}

public init(wrappedValue: Value?) {
self.init(wrappedValue: wrappedValue, request: EmptyLoadRequest())
}

public init(success value: Value) {
self.init(request: EmptyLoadRequest(), success: value)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComposableLoadable/LoadingReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extension Reducer {
)
}

// Integrate a Loadable child domain which does not require a Request type
/// Integrate a Loadable child domain which does not require a Request type
public func loadable<ChildState, ChildAction, Child: Reducer>(
_ toLoadableState: WritableKeyPath<State, LoadableState<EmptyLoadRequest, ChildState>>,
action toLoadingAction: CaseKeyPath<
Expand Down

0 comments on commit c54f985

Please sign in to comment.