Implement new update logic in wrappers
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 23:15:04 +01:00
parent 64c536b03c
commit 2cab78dedc
2 changed files with 2 additions and 6 deletions

View File

@ -22,9 +22,7 @@ struct InspectorWrapper: ConvenienceWidget {
data: WidgetData,
type: Data.Type
) -> ViewStorage where Data: ViewRenderData {
let storage = content.storage(data: data, type: type)
modify(storage, data, true)
return storage
content.storage(data: data, type: type)
}
/// Update the stored content.

View File

@ -24,9 +24,7 @@ struct SafeWrapper: ConvenienceWidget {
type: Data.Type
) -> ViewStorage where Data: ViewRenderData {
let contentStorage = content.storage(data: data, type: type)
let storage = ViewStorage(contentStorage.pointer, content: [.mainContent: [contentStorage]])
modify(storage, data, true)
return storage
return .init(contentStorage.pointer, content: [.mainContent: [contentStorage]])
}
/// Update the stored content.