Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So - as I've mentioned in the Discord server before, if one is making a widget library, there are sometimes occasions when the widget needs to know when the DOM is completely ready. When making a widget library, you can't simply listen for the
Readyevent sent to the App class. I've had a couple conversations with some other people that make widget libraries which has lead me to believe that a simple, universal solution to this issue would be very useful.There are various hacks to get around this of course. Previously to achieve this goal, I've been using a worker that just watches for
App._dom_readyon a loop, that seemed to be the most foolproof and simple method. However, I recently taught myself about the Signal API and I realized it would actually be the perfect solution to this problem. Widget libraries can simply subscribe to this signal, and thus be alerted when the DOM is ready regardless of where it is in the DOM hierarchy.I'm really hoping that this addition is a cake and not a puppy - that is to say, the addition of this signal should not have any affect on anything else or add any maintenance headaches.
I have tested this out in my own libraries and it works exactly as I intended, as well as of course passing all tests and whatnot. I feel quite confident about this PR since I think its solving a real problem in a simple and direct manner. Please let me know if you think there's any issues with this idea or if you'd like it to be modified - The Docstring maybe does not have the greatest wording!