bad abstract onMouseClick #35

Open
opened 2 months ago by glitch4347 · 2 comments
Owner

we have

  protected abstract onMouseOver(): void;
  protected abstract onMouseOut(): void;
  protected abstract onMouseMove(): void;
  protected abstract onMouseClick(): void;

in index.ts

the problem is that client code is forced to define this methods but it's bad practive because it should be necessasry if client doesn't want to.

we have ``` protected abstract onMouseOver(): void; protected abstract onMouseOut(): void; protected abstract onMouseMove(): void; protected abstract onMouseClick(): void; ``` in index.ts the problem is that client code is forced to define this methods but it's bad practive because it should be necessasry if client doesn't want to.
Poster
Owner

it's wrong becuse there is code

this.overlay
        .on('mouseover', this.onMouseOver.bind(this))
        .on('mouseout', this.onMouseOut.bind(this))
        .on('mousemove', this.onMouseMove.bind(this))
        .on('click', this.onMouseClick.bind(this))

which required this methods to exist

it's wrong becuse there is code ``` this.overlay .on('mouseover', this.onMouseOver.bind(this)) .on('mouseout', this.onMouseOut.bind(this)) .on('mousemove', this.onMouseMove.bind(this)) .on('click', this.onMouseClick.bind(this)) ``` which required this methods to exist
Poster
Owner

my motivation for this because it breacts bar-pod and others which not implements onClick added here: 493d52629c

my motivation for this because it breacts bar-pod and others which not implements `onClick` added here: https://code.corpglory.net/chartwerk/core/commit/493d52629c386aab0a8452295ed23f976474d3d0
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.