Pick the fix
Which is the best fit for 'load the profile once when the screen appears'?
Hint 1 of 1
How many values does this produce?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A An async function called from .task
Correct. It's one-shot, readable and cancelled automatically.
Why not the others?
- B A Combine pipeline with Future and sink. It works, but adds ceremony and cancellable management.
- C A PassthroughSubject the view subscribes to. Subjects are for streams, not one result.
- D NotificationCenter. It's global and untyped.