Skip to content

feat(view): replaced EventEmitter callback with EventEmitter observable#1376

Merged
vsavkin merged 1 commit into
angular:masterfrom
vsavkin:implement_event_emitters
Apr 16, 2015
Merged

feat(view): replaced EventEmitter callback with EventEmitter observable#1376
vsavkin merged 1 commit into
angular:masterfrom
vsavkin:implement_event_emitters

Conversation

@vsavkin
Copy link
Copy Markdown
Contributor

@vsavkin vsavkin commented Apr 15, 2015

This PR replaces EventEmitter callbacks with EventEmitter observables. It also updates forms to use EventEmitter.

Background:
We already use observables in forms and http. Imo we should use the same type in all these places. The added EventEmitter type implements the Observable/Stream interface and also allows pushing value.

A few things to note:

  • EventEmitter uses sync subscription and async delivery.
  • EventEmitter is cold. This means that if you fire an event in the constructor of your component, before a listener got attached to it, it will not be received by anyone.
  • The current implementation uses Rx/Dart Streams. This is temporary. We will either Rx3 or provide our own.

@mhevery @jeffbcross @yjbanov could you take a look?

@vsavkin vsavkin changed the title feat(view): changed event emitters to be observables feat(view): replaced EventEmitter callback with EventEmitter observable Apr 15, 2015
@yjbanov yjbanov self-assigned this Apr 15, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lookup can be done outside the inner for loop.

@yjbanov yjbanov added @lgtm action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Apr 15, 2015
@vsavkin
Copy link
Copy Markdown
Contributor Author

vsavkin commented Apr 15, 2015

@SekibOmazic we cannot use reflection to assign properties cause it will not perform well in Dart. We are thinking about using something like sweetjs to reduce the boilerplate.

@vsavkin vsavkin force-pushed the implement_event_emitters branch from 67eb786 to d6f2255 Compare April 16, 2015 00:35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add code example to the comments

@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Apr 16, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra ";" at eol

@vsavkin vsavkin force-pushed the implement_event_emitters branch 3 times, most recently from fddb715 to d7d9e4f Compare April 16, 2015 18:30
@mhevery mhevery mentioned this pull request Apr 16, 2015
21 tasks
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Apr 16, 2015

Please close #1250 when you merge this.

@vsavkin vsavkin force-pushed the implement_event_emitters branch 3 times, most recently from a401fe0 to cb94780 Compare April 16, 2015 21:19
@vsavkin vsavkin force-pushed the implement_event_emitters branch from cb94780 to 233cb0f Compare April 16, 2015 21:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants