-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Move sprite loading to a separate private method (refactoring of _load) #9226
Conversation
Thanks for your contribution. This issue is a little more complex than just exposing this function, e.g. it doesn't cover cases where the same URL is added multiple times, or when requesting multiple sprites simultaneously. Additionally, it's unclear what happens when different sprites provide an image with the same name. There are also various notifications that don't get fired for subsequent sprite loads ( We're planning to expand the way icons are supplied to support a bigger variety of use cases rather than just one sprite. However, due to the complexity of multiple sprite sheets or other image sources, we'll go through an RFC process to ensure that we've covered as many use cases as well as edge cases as possible before embarking on an implementation. Given this explanation, I'm going to close this PR for now since we can't merge it at the moment, even with modifications. However, we're very interested in learning more about your use cases for having multiple sprites because it will help us design an updated sprite/image/icon system that covers your use case. |
@kkaefer ok, that are good points that you first will go through the RFC process, I like that. |
That's a change that we'd probably accept. I assume your intention is to call this private method. Please refer to my explanation above for why that's not a good idea and will probably break in various edge cases. |
awesome 🎉
Yes, for sure. 😃
|
@kkaefer can you reopen? I forced-pushed the changes into this branch, but I guess changes are not tracked by closed PRs |
Unfortunately, I can't reopen this PR since Github won't let me with the message "The wb-loadSprite-as-style-method branch was force-pushed or recreated.". |
Launch Checklist
Just a bit of refactoring, since the code is very specific and it makes sense to put the logic out of
_load
to a private method.