Skip to content

Commit ed14579

Browse files
committed
Deprecate AtomTestContext.onUpdate
1 parent 8cc864d commit ed14579

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Sources/Atoms/Context/AtomTestContext.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ public struct AtomTestContext: AtomWatchableContext {
1818
location = SourceLocation(fileID: fileID, line: line)
1919
}
2020

21-
/// A callback to perform when any of the atoms watched by this context is updated.
22-
@inlinable
23-
public var onUpdate: (() -> Void)? {
24-
get { _state.onUpdate }
25-
nonmutating set { _state.onUpdate = newValue }
26-
}
27-
2821
/// Waits until any of the atoms watched through this context have been updated up to the
2922
/// specified timeout, and then returns a boolean value indicating whether an update has happened.
3023
///

Sources/Atoms/Deprecated.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ public extension AtomScope {
4343
scopedOverride(atomType, with: value)
4444
}
4545
}
46+
47+
public extension AtomTestContext {
48+
@available(*, deprecated, message: "Use `waitForUpdate(timeout:)` or `wait(for:timeout:until:)` instead")
49+
var onUpdate: (() -> Void)? {
50+
get { _state.onUpdate }
51+
nonmutating set { _state.onUpdate = newValue }
52+
}
53+
}

0 commit comments

Comments
 (0)