Combine: Blocking wait?

Is there anyway to blocking wait for X amount of elements to have been published, similiar to how RxBlocking's method func toBlocking(timeout: TimeInterval) throws -> BlockingObservable works?

Convenient for when writing tests

I suppose you could use XCTest’s expectation API instead and keep it all async

Yes, that's the proper way to write async tests in Swift, not making async API synchronous.

Terms of Service

Privacy Policy

Cookie Policy