Comments (3)
The reason is because this library doesn't want to be a resource caching and management system, just a loader. You shouldn't use this library for anything except the actual mechanism of loading data. All caching, resource management, knowing what is loaded and what isn't, deciding what to load, etc, should all exist as logic outside of this library.
The philosophy here is that once you've decided what to load, you fill a loader with requests and trigger it. If you're adding a name 2 times, then your higher-level logic is flawed and incorrectly had a duplicate in it.
As a more concrete statement, your project should have a Resource Manager that stores resources and manages their lifetime. When it decides something needs to be loaded from a remote source, only then does it create a loader and load them. It may have many loaders going at once, or only one. Up to you. Maybe it would be worthwhile for me to build a library that does that for people, built on top of this library.
from resource-loader.
@englercj it would be a good idea to make this more explicit up-front, perhaps in the main project readme. It is definitely unexpected behavior to folks coming new to the project and caused me a lot of debugging and googling to figure out what was going on.
My expectation was that if I requested loading an existing resource, the loader would simply queue it and immediately fire an onLoad once the loader starts just like a browser would with a dom node. I understand why you're not implementing that feature, but it is odd without the context you just provided.
(and thanks for this project - I really appreciate your work!)
from resource-loader.
I added this to the readme in the v4 typescript
branch.
from resource-loader.
Related Issues (20)
- Missing documentation? HOT 3
- ESM module & TS typings HOT 1
- Question re. handling errors on sub-resources in custom middleware HOT 4
- Version 3.0.0 is not transpiled
- Chrome Mobile Incognito Error HOT 1
- Best way to add new resource types and loading strategies? HOT 5
- Pixi resource-loader - add timeout to XHR request HOT 1
- may i load plist file from texturepacker? HOT 2
- Feature request: Font loading via CSS Font Loading API HOT 4
- Reload failed resources HOT 1
- Resource type as generic HOT 4
- Use resource-loader in a test (jest) context HOT 2
- Firefox fails to fire progress event without preload attribute HOT 3
- how to load from atlas from different sources, image one url json other? HOT 4
- Question Load SVG inline HOT 5
- How to check for video progress? HOT 3
- Pixi Loader use multiple times error HOT 1
- ResourceLoader.add(...) does not operate like a queue HOT 4
- parse-uri breaks ES5 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resource-loader.