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

Migrate to @Entry #401

Merged
merged 2 commits into from
Oct 30, 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
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
with:
lfs: true
- name: Test BSWInterfaceKit iOS
run: set -o pipefail && xcodebuild -scheme BSWInterfaceKit -destination "platform=iOS Simulator,name=iPhone 16,OS=18.0" test | xcbeautify --renderer github-actions
run: set -o pipefail && xcodebuild -scheme BSWInterfaceKit -destination "platform=iOS Simulator,name=iPhone 16,OS=18.1" test | xcbeautify --renderer github-actions
- name: Build BSWInterfaceKit macOS
run: set -o pipefail && swift build | xcbeautify --renderer github-actions
20 changes: 2 additions & 18 deletions Sources/BSWInterfaceKit/SwiftUI/Views/AsyncButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,25 +240,9 @@ public extension View {
}
}

private struct AsyncButtonLoadingStyleEnvironmentKey: EnvironmentKey {
static let defaultValue: AsyncButtonLoadingConfiguration = .init()
}

private struct AsyncButtonOperationIdentifierKey: EnvironmentKey {
static let defaultValue: String? = nil
}

private extension EnvironmentValues {

var asyncButtonLoadingConfiguration: AsyncButtonLoadingConfiguration {
get { self[AsyncButtonLoadingStyleEnvironmentKey.self] }
set { self[AsyncButtonLoadingStyleEnvironmentKey.self] = newValue }
}

var asyncButtonOperationIdentifierKey: String? {
get { self[AsyncButtonOperationIdentifierKey.self] }
set { self[AsyncButtonOperationIdentifierKey.self] = newValue }
}
@Entry var asyncButtonLoadingConfiguration = AsyncButtonLoadingConfiguration()
@Entry var asyncButtonOperationIdentifierKey: String? = nil
}

private extension Swift.Result where Failure == Error {
Expand Down
9 changes: 1 addition & 8 deletions Sources/BSWInterfaceKit/SwiftUI/Views/AsyncView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,8 @@ public extension View {
}
}

private struct DebounceOperationForMilliseconds: EnvironmentKey {
static let defaultValue: Double? = nil
}

private extension EnvironmentValues {
var debounceOperationForMilliseconds: Double? {
get { self[DebounceOperationForMilliseconds.self] }
set { self[DebounceOperationForMilliseconds.self] = newValue }
}
@Entry var debounceOperationForMilliseconds: Double? = nil
}

private extension AsyncView.Operation {
Expand Down
Loading