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

Don't execute until trigger/delay #134

Open
reintroducing opened this issue Feb 13, 2020 · 4 comments
Open

Don't execute until trigger/delay #134

reintroducing opened this issue Feb 13, 2020 · 4 comments

Comments

@reintroducing
Copy link

@reintroducing reintroducing commented Feb 13, 2020

I was under the impression that if I did this: axe(React, ReactDOM, 5000); axe wont execute until 5 seconds in. I'm basically trying to delay execution because axe is running before my page (with API calls) fully renders and I'm seeing issues that don't really exist once the API calls are finished and I render the page successfully with all elements. Am I misunderstanding that third parameter? How can I delay execution until a certain time (or ideally, it would plug in to some kind of event that I can fire and only execute then, but that may be out of the scope of this package)?

@straker

This comment has been minimized.

Copy link
Contributor

@straker straker commented Feb 13, 2020

I believe the 3rd parameter is a debounce delay that prevents multiple updates of the component from triggering multiple axe calls. So it won't wait 5 seconds to start analyzing. You'll probably need to wait for the API calls to settle before you initialize axe on the page.

@reintroducing

This comment has been minimized.

Copy link
Author

@reintroducing reintroducing commented Feb 13, 2020

@straker Got it, so that would work for initial page load, but how about when navigating around the site? subsequent pages also load APIs and axe is evaluating the loading state of the pages before the API calls come back.

@straker

This comment has been minimized.

Copy link
Contributor

@straker straker commented Feb 13, 2020

Excellent question. I'm not sure on that one. I'll try to find an answer and get back to you

@reintroducing

This comment has been minimized.

Copy link
Author

@reintroducing reintroducing commented Feb 13, 2020

Really appreciate your quick responses and help on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.