Offer a way to include the library into an arbitrary namespace#46
Offer a way to include the library into an arbitrary namespace#46rickhallett wants to merge 3 commits intoadamschwartz:masterfrom rickhallett:no-conflict
Conversation
|
Thanks! This is great. We’ll want to make sure we make these changes in the source I’d also like to improve on the method name
Of all of these, I think I’m most a fan of All of this being said, as I’m reminded that we do support RequireJS and AMD (which allow you to bring in |
|
Hi Adam, thanks for the feedback. Do you mean making the changes solely in log.coffee, or making them in both? I like log.export too, but export is often a reserved keyword, according to my linter. How about exportAndRestore? I've made a commit with these changes to the coffee.log file, but relied heavily on a converter available at http://js2.coffee/. I have removed what seems to be more obviously superfluous and synchronised comments with your original work. As for a more detailed evaluation of the the code, I would have to defer to your expertise. |
…tAndRestore implementation to Coffeescipt
|
You’ll want to make changes to |
PR based on issue #46
Changes suggested:
pass in the window object by parameter into the IIFE directly rather than use
call. This patterns mimics some of the major libraries in javascript and is functionally equivalent.add
restorePreviousLogReffunction that restores thewindow.logreference to whatever it was prior to loading the log library. This feature is exported via the exportifconditional from line 195 of the code base. Example use case below: