yandex / mapsapi-modules

Async modular system
132 stars 29 forks source link

If don't call provide in decl process wait for infinity #53

Open birhoff opened 8 years ago

birhoff commented 8 years ago

Main problem is that you don't know that. And all what you can do is check all your code. Maybe you can add some stats method to call when something go wrong. There is a method:

String getState(String name)

But if you has to many modules you just don't want to check them all. I see solution in some dependency graph with states. Minor example:

modules.define(
    'A',
    function(provide, prev) {
        var a = {};
        // do not call provide
        //provide(a);
    });

modules.require(
  ['A'],
  function(a) {
    /* never goes here */
  });
dfilatov commented 8 years ago

modules.getStat() can help you detect what module causes a problem.

birhoff commented 8 years ago

Yeah, this is what i wont, maybe add FAQ section where describe this method?

qfox commented 8 years ago

won't or want?

birhoff commented 8 years ago

of course want=) sorry for misspell.