Skip to content

Commit aa4e561

Browse files
committed
Add deprecated select modifier
1 parent fcf39a0 commit aa4e561

File tree

3 files changed

+9
-169
lines changed

3 files changed

+9
-169
lines changed

Package.resolved

Lines changed: 0 additions & 167 deletions
This file was deleted.

Sources/Atoms/Deprecated.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public extension Atom {
2+
@available(*, deprecated, renamed: "changes(of:)")
3+
func select<Selected: Equatable>(
4+
_ keyPath: KeyPath<Loader.Value, Selected>
5+
) -> ModifiedAtom<Self, ChangesOfModifier<Loader.Value, Selected>> {
6+
changes(of: keyPath)
7+
}
8+
}

Sources/Atoms/Modifier/ChangesModifier.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
public extension Atom where Loader.Value: Equatable {
2-
/// Prevents the atom from updating its downstream when its new value is
3-
/// equivalent to old value.
2+
/// Prevents the atom from updating its downstream when its new value is equivalent to old value.
43
///
54
/// ```swift
65
/// struct FlagAtom: StateAtom, Hashable {

0 commit comments

Comments
 (0)