Skip to content

Commit

Permalink
Update ifChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Oct 2, 2023
1 parent 01db3df commit 55b98d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Verge/Store/Changes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,15 @@ extension Changes where Value: Equatable {
previousPrimitive != primitive
}

@available(*, deprecated, message: "Use another function that returns IfChangedBox")
public func ifChanged(_ perform: (Value) throws -> Void) rethrows {
try ifChanged(\.self, perform)
}

public func ifChanged() -> IfChangedBox<Value> {
ifChanged({ $0 })
}

}

public struct IfChangedBox<T>: ~Copyable {
Expand Down

0 comments on commit 55b98d9

Please sign in to comment.