I'm confused as to how to fix this and wanted your opinion. I've created a library modeled after underscore's way of working with node and browsers. Here's a summarized version of the code: https://gist.github.com/76121b90fb1ae392a4de
Note that I'm using a Mixin to override the sync method for certain classes. In this case, the Session class. This is because some of our endpoints are not restful but JSON RPC so I have to handle them differently (see line 51).
The config gets passed to the instantiation of MyLibrary (line 86). Those config variables are then accessible as, for example, window.mylibrary.area.jsproxi. That is fine... The problem is I can't figure out an elegant way to access the same attributes of the instance from within the mixin.sync method (lines 11 and 12 are examples of this).
Any ideas? I don't know how to get the instance of MyLibrary from within the library after instantiation. ANd I can't use the name I'm attaching to window because I dont' know what this name will be.
Thank you very much!
Luis