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

feat: context object for onFinish to allow more control for developers #261

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

JamesLMilner
Copy link
Owner

Description of Changes

Adds context object to onFinish event to provide more context to how the finish event happened. This means you should be able to do this going forward:

draw.on("finish", (id: string, context: { action: string, mode: string }) => {
  if (action === 'draw') {
    // Do something for draw finish event
  } else if (action === 'dragFeature') {
    // Do something for a drag finish event
  } else if (action === 'dragCoordinate') {
    //
  }else if (action === 'dragCoordinateResize') {
    //
  }
});

Link to Issue

#253

PR Checklist

  • There is a associated GitHub issue
  • If I have added significant code changes, there are relevant tests
  • If there are behaviour changes these are documented

@JamesLMilner JamesLMilner marked this pull request as ready for review June 2, 2024 22:09
@JamesLMilner JamesLMilner merged commit b760255 into main Jun 2, 2024
8 checks passed
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