You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 25, 2019. It is now read-only.
event.preventDefault(), as I understand it, is used when chaining Workers such that if a Worker is spawned from inside a Worker, the error from the child Worker can be canceled by the parent Worker so as not to reach the Worker global scope and erroring out the entire "stack" of Workers. It doesn't bubble in the classical sense since there's no DOM to bubble through.
Worker's receive() to me is analogous to XHR's success(). While it's highly helpful to have a once(callback), it feels out of the scope of a facade. It's simple enough to attach more robust event handling to the facade; I also fear that once you add event handling with once() you will need the ability to on() and off().
Basically, it comes down to whether or not you expect to be able to call receive() multiple times to attach multiple callback handlers. My feeling is if you're expecting that layer, you might as well use libraries that dedicate themselves to that (e.g. jQuery.Callbacks).
Good point, I'll think that over but basically I would expect it to be like the H5.worker in the global scope, only without the error(). The send() and receive() methods would basically be matched with the receive() and send() of its parent.
Something to keep in mind is that loading scripts inside the Worker must be done within cross-domain boundaries and with a much more restrictive set of APIs. So whatever H5.worker(self) provides inside the Worker is forced to be lean!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
I would also like to include the ability to H5.worker( H5.blob() ), but that can wait till BlobBuilder is ready.