Closed z0mb1 closed 1 year ago
Hi, I like this idea of indeed being able to retry preloading assets in case the network is not stable.
Just one thing not clear in the example you provided in the source code where to you put the below code ? My only concern is about this feature being a user choice. what I mean is that by default we still have the current behaviour, but then you can choose to try re-preloading certain element.
@example
event.on(
event.LOADER_ERROR,
(res) => {
// custom function
showErrorNotification({
text: `Error during loading content: ${res.name}`,
done: loader.rePreload(res.src);
})
}
);
Hi, I like this idea of indeed being able to retry preloading assets in case the network is not stable.
Just one thing not clear in the example you provided in the source code where to you put the below code ? My only concern is about this feature being a user choice. what I mean is that by default we still have the current behaviour, but then you can choose to try re-preloading certain element.
@example event.on( event.LOADER_ERROR, (res) => { // custom function showErrorNotification({ text: `Error during loading content: ${res.name}`, done: loader.rePreload(res.src); }) } );
Hi. We could put the code itself in the onload
function, or any other function that is called when the application is initialized. my example is really quite specific. But this is due to the fact that the processing of unloaded assets can be implemented at the discretion of the user. In my example, as in my project, the function calls a notification with a button to reload. But you can do it in another way. For example, on a custom loading screen, display all unloaded assets. Also, I didn't use the standard UI, and I can assume that the implementation of this function will depend on the frameworks and libraries used. I would appreciate it if we could come up with a more understandable example together.
Hi Sorry, for the late feedback, and got it, and I will definitely give it a try once merged and think about how I would use it (to come up with an example)
Last comment or request before merging, can we maybe rename rePreload()
to reload()
? I just feel the name rePreload
is kind of strange :P
Hi Sorry, for the late feedback, and got it, and I will definitely give it a try once merged and think about how I would use it (to come up with an example)
Last comment or request before merging, can we maybe rename
rePreload()
toreload()
? I just feel the namerePreload
is kind of strange :P
sure, done
merged ! :)
thank you so much again for your contribution !
LOADER_ERROR
rePreload
to load asset, that was loaded with errorUserstory: I am trying to load project, but due to problems with the internet connection some of my assets load fails. I don't want to reload page and load whole project again. I want to upload again only failed assets.
Example decision: add notification about load failure with button to upload this asset again using
rePreload
function