Skip to content
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

Refactor global function access #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

friuns2
Copy link
Owner

@friuns2 friuns2 commented Jun 29, 2024

This pull request introduces a significant refactor across multiple components and the addition of a new TypeScript declaration file to improve the handling of global functions within the project.

  • New TypeScript Declaration File: Adds a globals.d.ts file to declare global functions such as calculateDirections, updateDistances, calculateDistance, updateLocation, placeHomeMarker, and clearMarkers. This centralizes the declaration of global functions, making them more manageable and accessible across the project.
  • Refactoring Components: Updates several Vue components (AttractionDetails.vue, AttractionList.vue, LocationModal.vue, and MapView.vue) to replace direct globalThis access with direct function calls as declared in globals.d.ts. This change streamlines the code and leverages TypeScript's type-checking features for better code reliability.
  • State Management: The state.js file remains unchanged, indicating that the global state management strategy does not directly utilize the newly declared global functions or has been refactored in a way that does not require modification to the state management logic.

For more details, open the Copilot Workspace session.

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.

1 participant