Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Observable instead of Subject #181

Closed
Brooooooklyn opened this issue Aug 29, 2017 · 4 comments
Closed

Use Observable instead of Subject #181

Brooooooklyn opened this issue Aug 29, 2017 · 4 comments
Assignees

Comments

@Brooooooklyn
Copy link
Contributor

Brooooooklyn commented Aug 29, 2017

I'm submitting a...


[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Support request => Please do not submit support request here

Current behavior

in some components, ng-zorro use subject to emit values when event callback triggered.
But this is not a good practice when writing Angular component.

Expected behavior

Use Observable.fromEvent / Observable.create to wrap eventListener, and dispose the eventListener in teardown logic when unsubscribe in ngOnDestroy.

Minimal reproduction of the problem with instructions

see #148

What is the motivation / use case for changing the behavior?

performance imporve

@Brooooooklyn
Copy link
Contributor Author

Brooooooklyn commented Aug 29, 2017

@vthinkxie @trotyl what do you think about this issue. if you are approving my suggestion, I will help you to change all Subject to Observable just like Dropdown.

@vthinkxie
Copy link
Member

@trotyl what do you think about it

@trotyl
Copy link
Contributor

trotyl commented Aug 31, 2017

Dropdown is a special case which has dynamic event trigger, I don't think it would apply to all components, is there any specific reason for that?

@lock
Copy link

lock bot commented Sep 17, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants