Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wfaler/2858321 to your computer and use it in GitHub Desktop.
Save wfaler/2858321 to your computer and use it in GitHub Desktop.
namespacingWithoutPollutingGlobalNamespace.coffee
# setting 'exports' as alias to global namespace
exports = this
# creating an empty object to act as a namespace for classes in this file
exports.ext = {}
# GreeterPanel is a previously defined CoffeeScript class
# namespacing and exposing GreeterPanel globally in the ext.GreeterPanel namespace
exports.ext.GreeterPanel = GreeterPanel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment