Skip to content

Conversation

@jackhkmatthews
Copy link
Contributor

Implemented imageLoaded event chain

@jackhkmatthews jackhkmatthews force-pushed the feature/load-event branch 3 times, most recently from 9e22532 to 6e868c7 Compare December 12, 2017 15:17

});

describe('iamge loaded', () => {

Choose a reason for hiding this comment

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

small typo here

* Incremented on each image load event.
*
* @type {number}
* @memberof ImageLoaderComponent

Choose a reason for hiding this comment

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

i think this should be AppComponent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected

(inViewportChange)="onInViewportChange($event)"
[debounce]="0">
[debounce]="0"
(load)="onImageLoad(image)">

Choose a reason for hiding this comment

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

I think the argument for the event handler needs to be $event like on line 8

* @memberof ImageLoaderComponent
*/
public onImageLoad(image: ResponsiveImage): void {
this.imageLoaded.emit(image);

Choose a reason for hiding this comment

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

I was thinking do we need to emit the image load event when the placeholder is loaded? is it useful?

…nt added for placeholder image

BREAKING CHANGE: The inputs and outputs to the image-loader component have changed
…ader component to match updated

BREAKING CHANGE: image-loader components updated inputs and outputs implemented
@jackhkmatthews jackhkmatthews dismissed edoparearyee’s stale review December 13, 2017 12:09

comments have been addressed

imgClass="foo"
alt="lorem ipsum"
(placeholderLoaded)="onPlaceholderLoad($event)"
(fullResLoaded)="onFullResLoad($event)"

Choose a reason for hiding this comment

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

I would be very clear and specific and call these events imageLoaded and imagePlaceholderLoaded as fullResLoaded sounds ambiguous

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

* @memberof ImageLoaderComponent
*/
@Output()
public fullResLoaded: EventEmitter<ImageLoadedEvent> = new EventEmitter<ImageLoadedEvent>();

Choose a reason for hiding this comment

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

Same here i would be clear and specific and call this imageLoaded

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

…fullResLoaded updated to imageL

BREAKING CHANGE: Variable name changes affect the image-loader component API
@jackhkmatthews jackhkmatthews dismissed edoparearyee’s stale review December 13, 2017 14:30

Suggestions implemented

@jackhkmatthews jackhkmatthews merged commit df4dcf2 into master Dec 13, 2017
@edoparearyee edoparearyee deleted the feature/load-event branch January 11, 2018 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants