Mark Lucking
Feb 27, 2021

--

Yes and No. I am not sure I understand your question. “patients” is an array, the fact that it is published within an observableObject means updates to it will tigger a view update in SwiftUI. The Just command here is accessing the array and effectively flattening it out, publishing each item within one at a time. I wrote another article just about flatMap here.

https://betterprogramming.pub/working-with-the-flatmap-combine-operator-in-ios-1267b6cf37ca

--

--

Mark Lucking
Mark Lucking

Written by Mark Lucking

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More

Responses (1)