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

Add emblaApi as a first parameter to event listeners #462

Closed
1 task done
Tracked by #321
davidjerleke opened this issue Apr 25, 2023 · 0 comments · Fixed by #463
Closed
1 task done
Tracked by #321

Add emblaApi as a first parameter to event listeners #462

davidjerleke opened this issue Apr 25, 2023 · 0 comments · Fixed by #463
Labels
feature request New feature or request resolved This issue is resolved

Comments

@davidjerleke
Copy link
Owner

davidjerleke commented Apr 25, 2023

Feature request is related to

  • embla-carousel (core package)

Describe the solution you'd like

  • Add emblaApi as a first parameter to event callbacks. This will make it easier to define event handler functions/callbacks without the need of having the emblaApi variable in the same scope.

Feature specification

Before this feature:

const onSelect = (eventName: EmblaEventType) => {
  console.log(`Embla just triggered ${eventName}!`)
}

After this feature:

const onSelect = (emblaApi: EmblaCarouselType, eventName: EmblaEventType) => {
  console.log(`Embla just triggered ${eventName}!`)
}
@davidjerleke davidjerleke added the feature request New feature or request label Apr 25, 2023
@davidjerleke davidjerleke linked a pull request Apr 25, 2023 that will close this issue
davidjerleke added a commit that referenced this issue Apr 25, 2023
Add `emblaApi` as a first parameter to event listeners
@davidjerleke davidjerleke added the resolved This issue is resolved label Apr 25, 2023
@davidjerleke davidjerleke mentioned this issue Apr 25, 2023
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request resolved This issue is resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant