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

Doi mayank/fix custom props #1111 #1523

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

DoiMayank
Copy link
Contributor

#1111
Extend event handlers to support custom properties in TypeScript

  • Created a BaseEventType with source and custom properties.
  • Extended event-specific types from the base type to ensure consistency.
  • Updated the _fire method in Events.js to merge custom payload with source.

- Created a BaseEventType with source and custom properties.
- Extended event-specific types from the base type to ensure consistency.
- Updated the _fire method in Events.js to merge custom payload with source.
@@ -698,7 +698,7 @@ const EventMixin = {

// private (very private) fire function
__fire(fireLayer, type, payload, source, customPayload = {}) {
payload = merge(payload, customPayload, { source });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed?

custom?: Record<string, any>;
}) => void;

export type GlobalRotateModeToggledEventHandler = BaseEventHandler & {
Copy link
Collaborator

Choose a reason for hiding this comment

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

All the other Events need the BaseEventHandler too.
Additionally I think we should provide a GlobalModeBaseEventHandler, because most of them are the same

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