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

Public method _scrollTo in ScrollAgent #7

Open
pepa-linha opened this issue Nov 15, 2019 · 1 comment
Open

Public method _scrollTo in ScrollAgent #7

pepa-linha opened this issue Nov 15, 2019 · 1 comment

Comments

@pepa-linha
Copy link

Hi, could method _scrollTo be public? I want call it from other scripts.

_scrollTo: function (to, force, instant) {

@jahudka
Copy link
Member

jahudka commented Nov 17, 2019

Hi, in theory of course it could, but I'm not sure I'm comfortable encouraging people to use the agent services separately from the transaction flow - an agent service should typically only serve as a bridge between a page transaction and a separate service which does the heavy lifting; the ScrollAgent simply didn't warrant a separate service at the time I was writing it, but the reality is that since it's also handling initial scroll offset and since it might be useful to access it outside the transaction flow as you seem to need, I should probably extract the actual scroll handling into a service which you'd then use and only have the agent forward calls to that service.. and this will require a bit more work than simply removing an underscore from the function name. Can you use the "private" signature in the meantime? It might take a while for me to get around to doing it properly..

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