subscribe(to:on:_:)
Subscribes to an event type, optionally limited to events affecting a source entity or scene.
Declaration
@MainActor @preconcurrency func subscribe<E>(to event: E.Type, on sourceObject: (any EventSource)? = nil, _ handler: @escaping (E) -> Void) -> any Cancellable where E : EventParameters
Return Value
An object that represents the subscription to this event stream.