Post

Replies

Boosts

Views

Activity

Reply to Swift Combine API client; return Future or AnyPublisher?
I don't have a definite answer on what the best practice is, but have wondered the same thing. In the past, I would return a Future. Now, I always return type-erased AnyPublisher. I find it keeps the interface more general, seems cleaner (standard) and, like you said, often it's easier to work. Besides, the type-erased Future returned as AnyPublisher is still going to finish after one output.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to Swift Combine API client; return Future or AnyPublisher?
I don't have a definite answer on what the best practice is, but have wondered the same thing. In the past, I would return a Future. Now, I always return type-erased AnyPublisher. I find it keeps the interface more general, seems cleaner (standard) and, like you said, often it's easier to work. Besides, the type-erased Future returned as AnyPublisher is still going to finish after one output.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode 13 + MacOS Big Sur (11.6) + M1 Chip + compile time
Don't have a solution, but I'm experiencing a similar thing with the same setup. Compiling the files seems ok, but other steps are getting stuck often.
Replies
Boosts
Views
Activity
Oct ’21