Skip to content

Instantly share code, notes, and snippets.

@andyman3000
Created April 3, 2013 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyman3000/5299459 to your computer and use it in GitHub Desktop.
Save andyman3000/5299459 to your computer and use it in GitHub Desktop.
Module pattern for CoffeeScript
app = ((app) ->
priv = ->
console.log "private func"
app.pub = ->
console.log "public func"
priv()
app
)((if typeof app is "undefined" then {} else app))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment