Modular system
What? Why and what for? How to use? (ru)
Requirements####
- Asynchronous require for modules
- Asynchronous provide for modules
- Extending and redefining a module
Why not CommonJS?####
See #1, #2 and #3 in the list of requirements.
Why not AMD?####
See #2 and #3 in the list of requirements.
API spec
Module declaration####
void modules
Module usage####
void modules
Modules storage configuration####
void
Available options#####
trackCircularDependencies
- if set to false doesn't track circular dependencies. true by defaultallowMultipleDeclarations
- if set to false denies module overloading and provides an error. true by default
Get current state of module in storage####
String
Possible states#####
NOT_DEFINED
- module wasn't definedNOT_RESOLVED
- module was defined, but it hasn't started resolvingIN_RESOLVING
- resolving is in progressRESOLVED
- module is already resolved
Check for module existence in storage####
Boolean
Create yet another modules storage####
Modules modules
Example####
modules; modules; modules; modules; modules;