Use new wrap modifier
Some checks are pending
Deploy Docs / publish (push) Waiting to run
SwiftLint / SwiftLint (push) Waiting to run

This commit is contained in:
david-swift 2026-02-02 21:26:50 +01:00
parent 19aa17c0ab
commit 6b76a4c8f4

View File

@ -271,13 +271,6 @@ extension AnyView {
style("frame", active: active) style("frame", active: active)
} }
/// Run a function when the view gets an update.
/// - Parameter onUpdate: The function.
/// - Returns: A view.
public func onUpdate(_ onUpdate: @escaping () -> Void) -> AnyView {
inspect { _, _ in onUpdate() }
}
/// Bind to the view's focus. /// Bind to the view's focus.
/// - Parameter focus: Whether the view is focused. /// - Parameter focus: Whether the view is focused.
/// - Returns: A view. /// - Returns: A view.
@ -341,7 +334,7 @@ extension AnyView {
/// - getString: Get the CSS. /// - getString: Get the CSS.
/// - Returns: A view. /// - Returns: A view.
public func css(scheme: ColorScheme? = nil, getString: @escaping () -> String) -> AnyView { public func css(scheme: ColorScheme? = nil, getString: @escaping () -> String) -> AnyView {
inspect { storage, updateProperties in wrap { storage, updateProperties in
let cssID = "internal-css" let cssID = "internal-css"
let providerID = "internal-css-provider" let providerID = "internal-css-provider"
let previous = storage.fields[cssID] as? String let previous = storage.fields[cssID] as? String