Post

Replies

Boosts

Views

Activity

Reply to Alternative option to initial onChange callback for EmptyView
I changed my approach to use ViewModifiers as which allows me to use existing view for callback: @MainActor struct AsyncStateModifier<T: Equatable>: ViewModifier { let input: T let action: (T) async -> Void let queue: AsyncActionQueue func body(content: Content) -> some View { return content .onChange(of: input, initial: true) { old, new in queue.process(action: action, with: new) } } }
May ’24