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

#158: deprecate onXXX methods and implement event off and once methods #172

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

XLPeng57
Copy link

Fixed #158

Key Changes:

  1. Deprecated Direct Event Methods: Replaced onXXX methods (e.g., onLoad, onClickTree) with map.on() for greater flexibility and consistency.
  2. Enhanced on, off, once Methods: Updated the on method with event name validation, added off to remove event handlers, and once for one-time event listeners.
  3. Refined Event Triggering Logic: Modified logic to support both deprecated methods and new event listeners, ensuring backward compatibility.

@dadiorchen dadiorchen self-assigned this Nov 20, 2023
@QuanGiap
Copy link

Hi XLPeng57, I have try out your code and it work great. I have use your code to implement a new event. This event will called when user select multimple trees

@dadiorchen
Copy link
Collaborator

@XLPeng57 sorry for the really delayed review, this is a beautiful PR, with some thoughtful consideration to make app respond well.

@dadiorchen dadiorchen merged commit f55dd8f into Greenstand:main Mar 29, 2024
2 checks passed
Copy link

🎉 This PR is included in version 2.7.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open event on and off API
3 participants