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

[Feature request] Sync callback #35

Open
acontreras89 opened this issue Jun 5, 2020 · 2 comments
Open

[Feature request] Sync callback #35

acontreras89 opened this issue Jun 5, 2020 · 2 comments

Comments

@acontreras89
Copy link
Contributor

acontreras89 commented Jun 5, 2020

It'd be handy to be able to pass a callback function that would be called every time the panes are sync. I have implemented this in a fork of my own and would be happy to open a PR if you're interested.

Something like

<ScrollSync onSync={() => console.log("Panes synchronized!")}>
  { /* ... some components including ScrollSyncPane */ }
</ScrollSync>

although we could discuss the name and signature of such function.

@okonet
Copy link
Owner

okonet commented Jun 5, 2020

Yes that would be great. What’s your use case?

@acontreras89
Copy link
Contributor Author

Basically I needed to add some more logic to your requestAnimationFrame code, as requesting frames of my own would make my code compete against yours causing some delay in my animations.

Also, adding a callback allowed me to reuse the logic of skipping scroll events caused by the synchronization of panels.

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

No branches or pull requests

2 participants