yield(while:)

Suspends the current task while a predicate on state is true.

ViewStore.swift:401
iOS
deprecated
macOS
deprecated
tvOS
deprecated
watchOS
deprecated
@MainActor func yield(while predicate: @escaping (_ state: ViewState) -> Bool) async

Parameters

predicate

A predicate on ViewState that determines for how long this method should suspend.

If you want to suspend at the same time you send an action to the view store, use send(_:while:).