Coder Social home page Coder Social logo

Comments (3)

englercj avatar englercj commented on June 9, 2024 1

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.

irongaze avatar irongaze commented on June 9, 2024 1

@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.

englercj avatar englercj commented on June 9, 2024 1

I added this to the readme in the v4 typescript branch.

from resource-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.