Reading time: 1 min

This quick recipe shows how to implement a Combine map operator that takes an async block. To do this, you need to:

  1. Use Task to run async code in a sync context.
  2. Use the Future publisher to publish the new value the Task is completed.
  3. Use flatMap to transfer from your current publisher to the Future one.

Continue Reading...

Reading time: 1 min

This quick recipe shows how to write an extension for a Combine Publisher whose output is of a generic type.

Continue Reading...

Reading time: 1 min

This recipe shows how to implement a timer in SwiftUI in order to update the UI state at a specific interval.

There are two ways of going about it:

  1. The simple one, with onReceive.
  2. A bit more complex, but also more powerful one, using SimpleTimer wrapper.

Continue Reading...