Protocol
InteractorScope
A protocol that exposes the active-state scope of an interactor.
protocol InteractorScope : AnyObject, Sendable
Mentioned In
Overview
InteractorScope separates the read-only “is this interactor currently active?” surface from the rest of Interactable. It is useful when you want a non-mutating view of an interactor — for example, to drive UI from isActiveStream without exposing activate() or deactivate().
Overview
An interactor is “active” between a successful call to activate() and the next call to deactivate(). Tasks spawned via task(priority:_:) are bound to that window and are cancelled on deactivation.
Both members are safe to read from any actor or thread; isActiveStream is nonisolated, and isActive reads under the lifecycle’s lock.
See Also
Interactable
See Also
InteractorLifecycle
Topics
Reading State
Relationships
Inherited By