bottlejs
bottlejs copied to clipboard
Missing documentation regarding lazy-loading functionality
At the top of the docs it mentions lazy-loading, but I can't find anything in the docs regarding where and how is this available.
Sample use-cases would be nice as well :-)
It lazy loads by default; there's no way to disable it.
let count = 0;
bottle.factory('SoLazy', container => {
count++;
return {};
});
console.log(count); // 0
bottle.container.SoLazy;
console.log(count); // 1
I guess it would make sense for me to spell that out in the readme; thanks for the suggestion!