-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: Remove rxjs events to avoid duplicate custom events in Angular #566
Conversation
/** | ||
* Custom modification | ||
* - Added conditional to add outputs | ||
*/ |
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.
Thanks for adding extra comments :)
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.
LGTM
FYI I'm still testing this -- should get to it by tonight :) |
/** | ||
* Custom modification | ||
* - Replaced import { fromEvent } from 'rxjs'; with import { EventEmitter } from '@angular/core'; | ||
*/ |
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.
/** | |
* Custom modification | |
* - Replaced import { fromEvent } from 'rxjs'; with import { EventEmitter } from '@angular/core'; | |
*/ | |
/** | |
* GCDS Modification | |
* Replaced | |
* import { fromEvent } from 'rxjs'; | |
* From: https://github.com/ionic-team/stencil-ds-output-targets/blob/9524c1ce970770e01afb493c292f71a2fe61b14a/packages/angular-output-target/angular-component-lib/utils.ts#L3 | |
*/ |
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.
Works pretty well, I tested by using our npm package 0.22.1 to verify that the events were being emitted twice, and then tested this PR and I can confirm that it is no longer firing twice.
Hoping to add more info in the comments about the changes so I added some suggestions in line. Thanks @ethanWallace !
Summary | Résumé
With the
v0.22.0
release of the@cdssnc/gcds-components-angular
,@Outputs
were added to the generated angular components. Unfortunately this was now causing custom events likegcdsClick
to be emitted twice.To fix, I removed Stencil's implementation of events from
rxjs
to remove the duplicate emitted events.Example angular component
Previously the
gcdsClick
would be emitted twice when either the button or pagination links were clicked. Now only one event is emitted.