-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
onReady might be executed twice #5049
Comments
You are correct that calling ready() in parallel can cause the onReady hooks to be triggered twice. This is because onReady hooks are triggered once for each call to be ready(). To avoid this issue, you can use a boolean flag to ensure that the onReady hooks are only triggered once. Here's an example:
|
If the above seems it can work, may be I will be able to work on this. @mcollina |
Yes... but it's likely going to be more tricky than that example. |
* fix: call onready once * fix: ensure on-ready promises are triggered in the right order * refactor: Apply suggestions from code review Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> * refactor: use promise as flow management --------- Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
If we call
ready()
in parallel, theonReady
hooks are triggered twiceNote that this is also a problem when using
inject()
The text was updated successfully, but these errors were encountered: