Skip to content

exercise-mouse-coordinate-done #5

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Smita81
Copy link
Collaborator

@Smita81 Smita81 commented May 6, 2024

No description provided.

@Smita81 Smita81 requested a review from dannyelcf May 6, 2024 11:26
@Smita81 Smita81 self-assigned this May 6, 2024
@@ -1,4 +1,7 @@
document
import {MOUSE_USER_INTERFACE, MOUSE_MOVE, MOUSE_POSITION} from "../data/constants";
Copy link
Owner

Choose a reason for hiding this comment

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

As these values are not used anymore, you can remove this import line.

Comment on lines +4 to 7
/*document
.getElementById('user-interface')
.addEventListener('mousemove', (event) => {
debugger;
Copy link
Owner

@dannyelcf dannyelcf May 7, 2024

Choose a reason for hiding this comment

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

You can remove all these lines once you already import './listener.js'

const xValue = event.pageX;
const yValue = event.pageY;
// execute core logic
const formattedCoordinates = 'X: ' + xValue + '\nY: ' + yValue;
Copy link
Owner

Choose a reason for hiding this comment

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

Use the function formatCoordinates of the util.js.

Ex:

Suggested change
const formattedCoordinates = 'X: ' + xValue + '\nY: ' + yValue;
const formattedCoordinates = formatCoordinates(xValue, yValue);

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.

2 participants