forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add
observed
to OutputEmitterRef
Prior to this commit, it wasn't possible to check whether the output had any listeners (if it was being observed). Before `output()`, we could check whether `EventEmitter` had any listeners by checking its `observed` property. In this commit, we convert `listeners` from a list to a signal so that we can have a computed `observed` signal. This commit only updates the `OutputEmitterRef` implementation. We can't update `OutputFromObservableRef` because it expects an observable signature to be provided, and the observable doesn't technically have any API to count subscribers; only `Subject` does. Please note that there have been different discussions on whether the `OutputEmitterRef` should be extended or not. This change is not considered breaking because the signature of the _private_ property has been changed and another property has been added to the public API. Related issue: angular#54837
- Loading branch information
Showing
3 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters