-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add finishedLoading event #2142
Comments
I have a free(ish) week comming up so I wanted to take a look at this, but I'm not sure how hard-core to go. I could: A) Do the easy thing and create a simple FINISHED_LOADING event that just notifies the developer when domToWorkspace() is finished and that's it. Is there an option you would prefer? |
Let's go with the simple solution (A). If we see more demand for it we can do the others later. Thanks! |
From BeksOmega via #2250 : |
In general, we're aiming to have high level APIs create and fire events. I think having the Events API fire additional events in response to things can make ownership of the events and defining which layer does what get messy quickly. I'd prefer to keep the responsibility for events in the API that's taking the action (eg, domToWorkspace() fires the event). |
Problem statement
Developers sometimes want to run some actions after a workspace finishes loading. There is no event to indicate this right now.
Expected Behavior
A new type of event,
finishedLoading
, is fired at the end ofBlockly.Xml.domToWorkspace
.Actual Behavior
No event is fired.
Additional Information
Another option is to include a flag on block creation events that indicates whether the event was fired while loading a workspace. This would help if developers are doing validation as each event comes in and want to respond differently depending on whether or not the workspace has been fully loaded.
The text was updated successfully, but these errors were encountered: