Category: requirejs

Singleton pattern in RequireJS 0

Singleton pattern in RequireJS

Yes this is possible and has its advantage. I use it often for Toolbox-like functions. This is the basic approach define(function (require) { var singleton = function () { return { ... }; };...