Skip to content

Force WithViewStore to be a view. #1910

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

Merged
merged 1 commit into from
Feb 17, 2023
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
383 changes: 0 additions & 383 deletions Sources/ComposableArchitecture/Internal/Deprecations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,389 +109,6 @@ extension ReducerProtocol {
}
#endif

// MARK: - Deprecated after 0.40.0:

@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
extension WithViewStore: AccessibilityRotorContent where Content: AccessibilityRotorContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute accessibility rotor content from store state.
///
/// - Parameters:
/// - store: A store.
/// - isDuplicate: A function to determine when two `ViewState` values are equal. When values
/// are equal, repeat view computations are removed,
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from an accessibility rotor content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
removeDuplicates isDuplicate: @escaping (ViewState, ViewState) -> Bool,
@AccessibilityRotorContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) ->
Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(
store: store,
removeDuplicates: isDuplicate,
content: content,
file: file,
line: line
)
}
}

@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
extension WithViewStore where ViewState: Equatable, Content: AccessibilityRotorContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute accessibility rotor content from equatable store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from an accessibility rotor content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
@AccessibilityRotorContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) ->
Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
extension WithViewStore where ViewState == Void, Content: AccessibilityRotorContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute accessibility rotor content from void store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from an accessibility rotor content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
file: StaticString = #fileID,
line: UInt = #line,
@AccessibilityRotorContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) ->
Content
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 14, macOS 11, *)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
extension WithViewStore: Commands where Content: Commands {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute commands from store state.
///
/// - Parameters:
/// - store: A store.
/// - isDuplicate: A function to determine when two `ViewState` values are equal. When values
/// are equal, repeat view computations are removed,
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a command builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
removeDuplicates isDuplicate: @escaping (ViewState, ViewState) -> Bool,
@CommandsBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(
store: store,
removeDuplicates: isDuplicate,
content: content,
file: file,
line: line
)
}
}

@available(iOS 14, macOS 11, *)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
extension WithViewStore where ViewState: Equatable, Content: Commands {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute commands from equatable store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a command builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
@CommandsBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 14, macOS 11, *)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
extension WithViewStore where ViewState == Void, Content: Commands {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute commands from void store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a command builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
file: StaticString = #fileID,
line: UInt = #line,
@CommandsBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore: Scene where Content: Scene {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute scenes from store state.
///
/// - Parameters:
/// - store: A store.
/// - isDuplicate: A function to determine when two `ViewState` values are equal. When values
/// are equal, repeat view computations are removed,
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a scene builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
removeDuplicates isDuplicate: @escaping (ViewState, ViewState) -> Bool,
@SceneBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(
store: store,
removeDuplicates: isDuplicate,
content: content,
file: file,
line: line
)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore where ViewState: Equatable, Content: Scene {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute scenes from equatable store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a scene builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
@SceneBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content,
file: StaticString = #fileID,
line: UInt = #line
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore where ViewState == Void, Content: Scene {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute scenes from void store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a scene builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
file: StaticString = #fileID,
line: UInt = #line,
@SceneBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content
) {
self.init(store, removeDuplicates: ==, content: content, file: file, line: line)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore: ToolbarContent where Content: ToolbarContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute toolbar content from store state.
///
/// - Parameters:
/// - store: A store.
/// - isDuplicate: A function to determine when two `ViewState` values are equal. When values
/// are equal, repeat view computations are removed,
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a toolbar content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
removeDuplicates isDuplicate: @escaping (ViewState, ViewState) -> Bool,
file: StaticString = #fileID,
line: UInt = #line,
@ToolbarContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content
) {
self.init(
store: store,
removeDuplicates: isDuplicate,
content: content,
file: file,
line: line
)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore where ViewState: Equatable, Content: ToolbarContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute toolbar content from equatable store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a toolbar content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
file: StaticString = #fileID,
line: UInt = #line,
@ToolbarContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content
) {
self.init(store, removeDuplicates: ==, file: file, line: line, content: content)
}
}

@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
extension WithViewStore where ViewState == Void, Content: ToolbarContent {
/// Initializes a structure that transforms a store into an observable view store in order to
/// compute toolbar content from void store state.
///
/// - Parameters:
/// - store: A store of equatable state.
/// - content: A function that can generate content from a view store.
@available(
*,
deprecated,
message:
"""
For compiler performance, using "WithViewStore" from a toolbar content builder is no longer supported. Extract this "WithViewStore" to the parent view, instead, or observe your view store from an "@ObservedObject" property.

See the documentation for "WithViewStore" (https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/viewstore#overview) for more information.
"""
)
public init(
_ store: Store<ViewState, ViewAction>,
file: StaticString = #fileID,
line: UInt = #line,
@ToolbarContentBuilder content: @escaping (ViewStore<ViewState, ViewAction>) -> Content
) {
self.init(store, removeDuplicates: ==, file: file, line: line, content: content)
}
}

// MARK: - Deprecated after 0.39.1:

extension WithViewStore {
Expand Down
Loading