Skip to content

Commit

Permalink
refactor(controls): rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
berndartmueller committed Aug 28, 2020
1 parent 03cd276 commit 31eb236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"responsive",
"image-slider",
"image-swiper",
"swiper"
"swiper",
"virchual"
],
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
Expand Down
6 changes: 3 additions & 3 deletions src/components/controls/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { identity } from '../../types';
import { stop } from '../../utils/event';

export class Controls implements Component {
private buttons: HTMLButtonElement[];
private controls: HTMLButtonElement[];
private onClickBound: () => identity;

constructor(private dependencies: ComponentDependencies) {
this.buttons = [].slice.call(dependencies.virchual.container.querySelectorAll('.virchual__control'));
this.controls = [].slice.call(dependencies.virchual.container.querySelectorAll('.virchual__control'));

dependencies.eventBus.on('destroy', () => {
console.log('controls component destroy');
Expand All @@ -17,7 +17,7 @@ export class Controls implements Component {
}

mount(): void {
this.buttons.forEach(button => this.dependencies.eventBus.on('click', this.onClickBound, button));
this.controls.forEach(button => this.dependencies.eventBus.on('click', this.onClickBound, button));
}

private onClick(event: MouseEvent) {
Expand Down

0 comments on commit 31eb236

Please sign in to comment.