John O'Reilly
09/23/2024, 10:35 AMObserving
and wondering if there should be way to run some swift code/create some derived state based on result of that?John O'Reilly
09/23/2024, 10:38 AMonChange
not getting triggered
Observing(someState) { value in
}.onChange(of: someState.value) { oldValue, newValue in
print("Changing from \(oldValue) to \(newValue)")
}
Filip Dolník
09/23/2024, 11:52 AMText("Manually updated counter: \(manuallyUpdatedCounter)")
.collect(flow: viewModel.counter) { latestValue in
manuallyUpdatedCounter = latestValue.intValue
}
Filip Dolník
09/23/2024, 11:54 AMsomeState.value
most likely isn’t)John O'Reilly
09/23/2024, 11:55 AMonChange
....more how to do run that logic when it changesJohn O'Reilly
09/23/2024, 11:55 AMfor await
in .task
view modifierFilip Dolník
09/23/2024, 11:56 AMcollect
function.John O'Reilly
09/26/2024, 3:39 PM