Document difference between EventEmitter and Subject
See original GitHub issueThere is no documentation about the difference between Subject
and EventEmitter
. AFAIK, the only differences are EventEmitter’s duplicative emit()
and optional asynchronous mode.
Of the two, Subject
is shorter, better documented, and is not unique to Angular, so I always prefer Subject
.
I have no idea if I am getting something important wrong by doing this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Angular 2 Event emitters vs Subject - Stack Overflow
EventEmitter by default is synchronous, whereas Subject is not. You can pass a flag to EventEmitter to make it asynchronous ...
Read more >Event Emitter vs Service vs Subject( Cross component ...
A subject is a special kind of observable. It maintains the stream of data which is maintained actively. A subject is an observer...
Read more >Why EventEmitters instead of Subjects in Angular
One of them is the EventEmitter class that's used solely for emitting custom events in @Output -decorated properties, like this: @Component({ ..
Read more >Difference between EventEmitter and Subject : r/angular - Reddit
For example, if the parent component controls a form and user makes a selection in the child component and based on that action...
Read more >Angular Event Emitter Vs Subject - StackBlitz
A little demo to show the differences between EventEmitters and Subjects in Angular.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
EventEmitter is an Angular abstraction. It being a subject is an implementation detail and not public API.
You should treat them as conceptually different things.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.