Swift Combine CompactMap vs flatMap

map vs compactMap vs flatMap

First We see the code

map battle

CompactMap filter ‘nil’

And you use .publish. it will send the value one by one.