question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document difference between EventEmitter and Subject

See original GitHub issue

There 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:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Airbladercommented, Mar 24, 2019

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.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 15, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found