-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor(module:dropdown): improve performance #148
Conversation
c8e5134
to
88dee68
Compare
import { debounceTime } from 'rxjs/operator/debounceTime'; | ||
import 'rxjs/add/operator/debounceTime'; | ||
import 'rxjs/add/operator/do'; | ||
import 'rxjs/add/operator/merge'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library should not use rxjs patching mechanism as suggested in angular/components#5314
88dee68
to
35d92a2
Compare
} from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
import { debounceTime } from 'rxjs/operator/debounceTime'; | ||
import 'rxjs/add/operator/debounceTime'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library should not use rxjs patching mechanism as suggested in angular/components#2622, angular/components#2652, angular/components#3716, angular/components#5314 (original line has been modified)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
35d92a2
to
bd4e82f
Compare
are you sure it works? |
this._renderer.listen(this._nzOrigin.elementRef.nativeElement, 'mouseenter', () => this._show()); | ||
this._renderer.listen(this._nzOrigin.elementRef.nativeElement, 'mouseleave', () => this._hide()); | ||
mouse$ = Observable.create((observer: Observer<boolean>) => { | ||
const disposeMouseEnter = this._renderer.listen(this._nzOrigin.elementRef.nativeElement, 'mouseenter', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check whether will fire ngzone. although this component will not check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zone propagation for RxJS has been fixed on Zone.js side already.
1. use Observable to replace Subject, which could dispose eventListener. 2. use ChangeDetectionStrategy.OnPush to reduce check times.
bd4e82f
to
f88c1fa
Compare
Concerns irrelevant to this PR, currently all event triggers are generalized and applied to a debounce of |
* master: refactor(module:dropdown): improve performance (NG-ZORRO#148) feat(module:tooltip,popconfirm,popover): support OnPush (NG-ZORRO#143) release(0.5.0-rc.3): pre-release 0.5.0-rc.3 (NG-ZORRO#166) fix(module:carousel): fix carousel auto play bug (NG-ZORRO#164) fix(module:input): fix input disabled style bug (NG-ZORRO#160) fix(module:input): fix input disabled style bug (NG-ZORRO#108) fix(module:affix,anchor,back-top): fix and improve rxjs usage (NG-ZORRO#159) feat(module:affix&anchor&back-top&avatar): add components to library (NG-ZORRO#88) fix(module:select): fix select reset bug in form (NG-ZORRO#153) fix(module:pagination) fix pagination double binding (NG-ZORRO#146) fix(module:select): fix option incorrect active status (NG-ZORRO#141) feat(module:root): make nz-root optional (NG-ZORRO#36)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information